﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Binding WebGrid.NET to ObjectDataSource </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Binding-WebGridNET-to-ObjectDataSource/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Binding WebGrid.NET to ObjectDataSource </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Binding-WebGridNET-to-ObjectDataSource/</link><pubDate>Sun, 19 Sep 2010 22:39:08 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;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:&lt;/p&gt;&lt;pre&gt;// using Generic Collection&lt;br /&gt;[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]&lt;br /&gt;public List&amp;lt;Customer&amp;gt; GetCustomersFiltered(string ContactTitle)&lt;br /&gt;{&lt;br /&gt;    List&amp;lt;Customer&amp;gt; customers = new List&amp;lt;Customer&amp;gt;();&lt;br /&gt;&lt;br /&gt;    try&lt;br /&gt;    {&lt;br /&gt;        this.Connection.Open();&lt;br /&gt;&lt;br /&gt;        string cmdText = "SELECT " &amp;#43;&lt;br /&gt;            "CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, " &amp;#43;&lt;br /&gt;            "PostalCode, Country, Phone, Fax FROM Customers";&lt;br /&gt;&lt;br /&gt;        if (!string.IsNullOrEmpty(ContactTitle))&lt;br /&gt;            cmdText &amp;#43;= " WHERE ContactTitle = '" &amp;#43; ContactTitle &amp;#43; "'";&lt;br /&gt;&lt;br /&gt;        OleDbCommand command = new OleDbCommand(cmdText, this.Connection);&lt;br /&gt;&lt;br /&gt;        OleDbDataReader reader = command.ExecuteReader();&lt;br /&gt;&lt;br /&gt;        while (reader.Read())&lt;br /&gt;        {&lt;br /&gt;            Customer customer = new Customer();&lt;br /&gt;            customer.CustomerID = reader.GetString(0);&lt;br /&gt;            customer.CompanyName = reader.GetString(1);&lt;br /&gt;            customer.ContactName = reader.GetString(2);&lt;br /&gt;            customer.ContactTitle = reader.GetString(3);&lt;br /&gt;            customer.Address = reader.GetString(4);&lt;br /&gt;            customer.City = reader.GetString(5);&lt;br /&gt;            customer.Region = reader.IsDBNull(6) ? "" : reader.GetString(6);&lt;br /&gt;            customer.PostalCode = reader.IsDBNull(7) ? "" : reader.GetString(7);&lt;br /&gt;            customer.Country = reader.IsDBNull(8) ? "" : reader.GetString(8);&lt;br /&gt;            customer.Phone = reader.IsDBNull(9) ? "" : reader.GetString(9);&lt;br /&gt;            customer.Fax = reader.IsDBNull(10) ? "" : reader.GetString(10);&lt;br /&gt;&lt;br /&gt;            customers.Add(customer);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        return customers;&lt;br /&gt;    }&lt;br /&gt;    finally&lt;br /&gt;    {&lt;br /&gt;        this.Connection.Close();&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;Without query string the page will list all customer, if we wish to show all the Owner, the query string will be &lt;em&gt;?ContactTitle=Owner&lt;/em&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Binding WebGrid.NET to ObjectDataSource </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Binding-WebGridNET-to-ObjectDataSource/</link><pubDate>Sat, 18 Sep 2010 04:59:20 GMT</pubDate><dc:creator>jasminshikalgar</dc:creator><description>&lt;p&gt;Hai,&lt;br /&gt;I have the problem with binding WebGrid.NET to ObjectDataSource &lt;br /&gt;if i keep parameter sources  control,query or  session .&lt;br /&gt;The data is not updating ,the value is going Null in database&lt;/p&gt;</description></item></channel></rss>