iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hai,I have the problem with binding WebGrid.NET to ObjectDataSource if i keep parameter sources control,query or session .The data is not updating ,the value is going Null in database
Based on my test, using query string select parameter I could successfully filtered the data in the Grid. Attached is the page I used to test the scenario.
The GenericObject class is already available on the WebGrid provided sample under the folder App_Code/GenericObject. Plese add a new function GetCustomersFiltered, here is the snippet:
// using Generic Collection[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]public List<Customer> GetCustomersFiltered(string ContactTitle){ List<Customer> customers = new List<Customer>(); try { this.Connection.Open(); string cmdText = "SELECT " + "CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, " + "PostalCode, Country, Phone, Fax FROM Customers"; if (!string.IsNullOrEmpty(ContactTitle)) cmdText += " WHERE ContactTitle = '" + ContactTitle + "'"; OleDbCommand command = new OleDbCommand(cmdText, this.Connection); OleDbDataReader reader = command.ExecuteReader(); while (reader.Read()) { Customer customer = new Customer(); customer.CustomerID = reader.GetString(0); customer.CompanyName = reader.GetString(1); customer.ContactName = reader.GetString(2); customer.ContactTitle = reader.GetString(3); customer.Address = reader.GetString(4); customer.City = reader.GetString(5); customer.Region = reader.IsDBNull(6) ? "" : reader.GetString(6); customer.PostalCode = reader.IsDBNull(7) ? "" : reader.GetString(7); customer.Country = reader.IsDBNull(8) ? "" : reader.GetString(8); customer.Phone = reader.IsDBNull(9) ? "" : reader.GetString(9); customer.Fax = reader.IsDBNull(10) ? "" : reader.GetString(10); customers.Add(customer); } return customers; } finally { this.Connection.Close(); }}
Without query string the page will list all customer, if we wish to show all the Owner, the query string will be ?ContactTitle=Owner
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname