<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DEIARXoyeSp7ImA9WhRWE0w.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772</id><updated>2011-12-30T23:29:04.491-08:00</updated><category term="JQuery" /><category term="ADO.NET 2.0" /><category term="MVC" /><category term="SEO" /><category term="Linq" /><category term="JQGrid" /><category term="Search Engine Optimization" /><category term="Build Automation" /><category term="Meta Tags" /><category term="Chart" /><category term="JSON" /><category term="Oracle" /><category term="WPF" /><category term=".NET 3.5" /><category term="Silverlight" /><category term="ASP.NET" /><category term="ADO.NET" /><title>Abdul Rahuman's blog</title><subtitle type="html">About .NET ,Oracle SOA Suite and JDeveloper</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://arahuman.blogspot.com/" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/AbdulRahumansBlog" /><feedburner:info uri="abdulrahumansblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CE8ESX45fSp7ImA9WxFUFU0.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-2838073344748759657</id><published>2009-06-30T21:02:00.000-07:00</published><updated>2010-06-25T14:53:28.025-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-25T14:53:28.025-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="JSON" /><category scheme="http://www.blogger.com/atom/ns#" term="JQGrid" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title>Master Detail JQGrid using MVC and JSON</title><content type="html">In my previous article i have covered an example of using JQGrid using MVC and Jason( You can find my previous article &lt;a href="http://arahuman.blogspot.com/2009/06/jqgrid-using-mvc-json-and-datatable.html"&gt;here&lt;/a&gt;. Based on the response i received for the previous article, i thought of putting together another example on Master Detail JQGrid using MVC and JSON.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_KG5zJqqvNd4/SkrjJsh6UAI/AAAAAAAAAWQ/55sEkDC1Tu8/s1600-h/MVC+MasterDetail.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 600px; height: 437px;" src="http://1.bp.blogspot.com/_KG5zJqqvNd4/SkrjJsh6UAI/AAAAAAAAAWQ/55sEkDC1Tu8/s400/MVC+MasterDetail.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5353340862794977282" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here i will talking mostly the difference between my previous article and current one. From the first grid i am capturing the OnSelectRow event whenever a row is clicked. The id from the selected row gets passed as an Query Parameter, which then gets used to pull all the detail rows. You can also dynamically set the caption for the detail grid from your OnSelectRow event as shown below.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; MasterPageFile=&amp;quot;~/Views/Shared/Site.Master&amp;quot; Inherits=&amp;quot;System.Web.Mvc.ViewPage&amp;quot; %&amp;gt;&lt;br /&gt;&amp;lt;asp:Content ID=&amp;quot;indexTitle&amp;quot; ContentPlaceHolderID=&amp;quot;TitleContent&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    Home Page&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&amp;lt;asp:Content ID=&amp;quot;indexContent&amp;quot; ContentPlaceHolderID=&amp;quot;HeadContent&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;        jQuery(document).ready(function() {&lt;br /&gt;            jQuery(&amp;quot;#list&amp;quot;).jqGrid({&lt;br /&gt;            url: '/Home/GetGridData/',&lt;br /&gt;                datatype: 'json',&lt;br /&gt;                mtype: 'GET',&lt;br /&gt;                colNames: ['Customer ID', 'Contact Name', 'Address', 'City', 'Postal Code'],&lt;br /&gt;                colModel: [&lt;br /&gt;                  { name: 'CustomerID', index: 'CustomerID', width: 100, align: 'left' },&lt;br /&gt;                  { name: 'ContactName', index: 'ContactName', width: 150, align: 'left' },&lt;br /&gt;                  { name: 'Address', index: 'Address', width: 300, align: 'left' },&lt;br /&gt;                  { name: 'City', index: 'City', width: 150, align: 'left' },&lt;br /&gt;                  { name: 'PostalCode', index: 'PostalCode', width: 100, align: 'left' }&lt;br /&gt;                ],&lt;br /&gt;                pager: jQuery('#pager'),&lt;br /&gt;                rowNum: 10,&lt;br /&gt;                rowList: [5, 10, 20, 50],&lt;br /&gt;                sortname: 'CustomerID',&lt;br /&gt;                sortorder: &amp;quot;asc&amp;quot;,&lt;br /&gt;                viewrecords: true,&lt;br /&gt;                imgpath: '/scripts/themes/steel/images',&lt;br /&gt;                caption: '&amp;lt;b&amp;gt;Northwind Customer Information&amp;lt;/b&amp;gt;',&lt;br /&gt;                onSelectRow: function(ids) {&lt;br /&gt;                    if (ids != null) {&lt;br /&gt;                        var data = $(&amp;quot;#list&amp;quot;).getRowData(ids);&lt;br /&gt;                        jQuery(&amp;quot;#OrderList&amp;quot;).setGridParam({ url: &amp;quot;/Home/GetDetailGridData/&amp;quot; + data.CustomerID, page: 1 })&lt;br /&gt;               .setCaption(&amp;quot;&amp;lt;b&amp;gt;Order Details for : &amp;quot; + data.ContactName+&amp;quot;&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;               .trigger('reloadGrid');&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }).navGrid(pager, { edit: false, add: false, del: false, refresh: true, search: false });&lt;br /&gt;            jQuery(&amp;quot;#OrderList&amp;quot;).jqGrid&lt;br /&gt;            ({&lt;br /&gt;                height: 100,&lt;br /&gt;                datatype: &amp;quot;json&amp;quot;,&lt;br /&gt;                colNames: ['Order Date', 'Shipped Date', 'Freight', 'Ship Name', 'Ship Address', 'Ship City', 'Ship PostalCode'],&lt;br /&gt;                colModel:&lt;br /&gt;                [&lt;br /&gt;                  { name: 'OrderDate', index: 'OrderDate', width: 100, align: 'left' },&lt;br /&gt;                  { name: 'ShippedDate', index: 'ShippedDate', width: 100, align: 'left' },&lt;br /&gt;                  { name: 'Freight', index: 'Freight', width: 100, align: 'left' },&lt;br /&gt;                  { name: 'ShipName', index: 'ShipName', width: 150, align: 'left' },&lt;br /&gt;                  { name: 'ShipAddress', index: 'ShipAddress', width: 150, align: 'left' },&lt;br /&gt;                  { name: 'ShipCity', index: 'ShipCity', width: 100, align: 'left' },&lt;br /&gt;                  { name: 'ShipPostalCode', index: 'ShipPostalCode', width: 100, align: 'left' }&lt;br /&gt;                ],&lt;br /&gt;                rowNum: 5,&lt;br /&gt;                rowList: [5, 10, 20],&lt;br /&gt;                imgpath: '/scripts/themes/steel/images',&lt;br /&gt;                pager: jQuery('#OrderPager'),&lt;br /&gt;                sortname: 'OrderDate',&lt;br /&gt;                viewrecords: true,&lt;br /&gt;                sortorder: &amp;quot;desc&amp;quot;&lt;br /&gt;            }).navGrid('#OrderPager', { add: false, edit: false, del: false, search: false });&lt;br /&gt;        });&lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&amp;lt;asp:Content ID=&amp;quot;Content1&amp;quot; ContentPlaceHolderID=&amp;quot;MainContent&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;h2&amp;gt;&lt;br /&gt;        Customers List&amp;lt;/h2&amp;gt;&lt;br /&gt;    &amp;lt;table id=&amp;quot;list&amp;quot; class=&amp;quot;scroll&amp;quot; cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;/table&amp;gt;&lt;br /&gt;    &amp;lt;div id=&amp;quot;pager&amp;quot; class=&amp;quot;scroll&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;h2&amp;gt;Orders&amp;lt;/h2&amp;gt;&lt;br /&gt;    &amp;lt;table id=&amp;quot;OrderList&amp;quot; class=&amp;quot;scroll&amp;quot; cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;/table&amp;gt;&lt;br /&gt;    &amp;lt;div id=&amp;quot;OrderPager&amp;quot; class=&amp;quot;scroll&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;trigger function will reload the detail grid. &lt;br /&gt;&lt;br /&gt;I have written a new controller method for getting the data for the detail grid. The URL to this method gets set on the same onSelectRow event as shown above. &lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Mvc;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Data;&lt;br /&gt;using JQGridMVCDemo.Helper;&lt;br /&gt;&lt;br /&gt;namespace MvcApplication1.Controllers {&lt;br /&gt;    [HandleError]&lt;br /&gt;    public class HomeController : Controller {&lt;br /&gt;        public ActionResult Index() {&lt;br /&gt;            ViewData["Message"] = "Welcome to ASP.NET MVC!";&lt;br /&gt;            return View();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public ActionResult About() {&lt;br /&gt;            return View();&lt;br /&gt;        }&lt;br /&gt;        public ActionResult GetDetailGridData(string id,string sidx, string sord, int page, int rows) {&lt;br /&gt;            int startIndex = ((page - 1) * rows) + 1;&lt;br /&gt;            int endIndex = page * rows;&lt;br /&gt;            string tcQuery = @"SELECT COUNT(*) FROM Orders WHERE CustomerID='"+id+"'";&lt;br /&gt;            string dtQuery = @"WITH PAGED_ORDERS  AS&lt;br /&gt;                                (&lt;br /&gt;                                    SELECT OrderDate, ShippedDate, Freight, ShipName, ShipAddress, &lt;br /&gt;                                        ShipCity, ShipPostalCode,ROW_NUMBER() &lt;br /&gt;                                 OVER (ORDER BY " + sidx + @" " + sord + @") AS RowNumber&lt;br /&gt;                                    FROM ORDERS&lt;br /&gt;                                 WHERE CustomerID='" + id + @"'&lt;br /&gt;                                )&lt;br /&gt;                                SELECT CONVERT(VARCHAR(10), OrderDate, 101) OrderDate, &lt;br /&gt;                                 CONVERT(VARCHAR(10), ShippedDate, 101) ShippedDate, &lt;br /&gt;                                 Freight, ShipName, ShipAddress, ShipCity, ShipPostalCode&lt;br /&gt;                                FROM PAGED_ORDERS&lt;br /&gt;                                WHERE RowNumber BETWEEN " + startIndex + @" AND " + endIndex + @";";&lt;br /&gt;            return Content(JsonHelper.JsonForJqgrid(GetDataTable(dtQuery), rows, GetTotalCount(tcQuery), page), "application/json");&lt;br /&gt;        }&lt;br /&gt;        public ActionResult GetGridData(string sidx, string sord, int page, int rows) {&lt;br /&gt;            int startIndex = ((page - 1) * rows) + 1;&lt;br /&gt;            int endIndex = page * rows;&lt;br /&gt;            string tcQuery = @"SELECT COUNT(*) FROM Customers";&lt;br /&gt;            string dtQuery = @"WITH PAGED_CUSTOMERS  AS&lt;br /&gt;                        (&lt;br /&gt;                         SELECT  CustomerID, ContactName, Address, City, PostalCode,&lt;br /&gt;                           ROW_NUMBER() OVER (ORDER BY " + sidx + @" " + sord + @") AS RowNumber&lt;br /&gt;                         FROM CUSTOMERS&lt;br /&gt;                        )&lt;br /&gt;                        SELECT CustomerID, ContactName, Address, City, PostalCode&lt;br /&gt;                        FROM PAGED_CUSTOMERS&lt;br /&gt;                        WHERE RowNumber BETWEEN " + startIndex + @" AND " + endIndex + @";";&lt;br /&gt;&lt;br /&gt;            return Content(JsonHelper.JsonForJqgrid(GetDataTable(dtQuery), rows, GetTotalCount(tcQuery), page), "application/json");&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public DataTable GetDataTable(string sql) {&lt;br /&gt;            DataTable dt = new DataTable();&lt;br /&gt;            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["mainConnection"].ConnectionString);&lt;br /&gt;            SqlDataAdapter adap = new SqlDataAdapter(sql,conn);&lt;br /&gt;            var rows=adap.Fill(dt);&lt;br /&gt;            return dt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public int GetTotalCount(string sql) {&lt;br /&gt;            SqlConnection conn=null;&lt;br /&gt;            try {&lt;br /&gt;                 conn= new SqlConnection(ConfigurationManager.ConnectionStrings["mainConnection"].ConnectionString);&lt;br /&gt;                SqlCommand comm = new SqlCommand(sql, conn);&lt;br /&gt;                conn.Open();&lt;br /&gt;                return (int)comm.ExecuteScalar();&lt;br /&gt;            } catch {&lt;br /&gt;            } finally {&lt;br /&gt;                try {&lt;br /&gt;                    if (ConnectionState.Closed != conn.State) {&lt;br /&gt;                        conn.Close();&lt;br /&gt;                    }&lt;br /&gt;                }catch {&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            return -1;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can download the sample code &lt;a href="http://arahuman.googlepages.com/JQGridMVCDemoMaster.zip"&gt;&lt;br /&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 50px; height: 50px;" src="http://1.bp.blogspot.com/_KG5zJqqvNd4/Skwx_qyImfI/AAAAAAAAAWY/v1o-Dw1-AU8/s200/zip-file-icon.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5353709026922764786" /&gt;&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-2838073344748759657?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cd1pER0G8AM7bopgKxk_zrxY5lQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cd1pER0G8AM7bopgKxk_zrxY5lQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cd1pER0G8AM7bopgKxk_zrxY5lQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cd1pER0G8AM7bopgKxk_zrxY5lQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/4wApjnZQmGA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/2838073344748759657/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2009/06/master-detail-jqgrid-using-mvc-and-json.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/2838073344748759657?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/2838073344748759657?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/4wApjnZQmGA/master-detail-jqgrid-using-mvc-and-json.html" title="Master Detail JQGrid using MVC and JSON" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_KG5zJqqvNd4/SkrjJsh6UAI/AAAAAAAAAWQ/55sEkDC1Tu8/s72-c/MVC+MasterDetail.png" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2009/06/master-detail-jqgrid-using-mvc-and-json.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMCSX87cCp7ImA9WxJVEkk.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-8073238388920528955</id><published>2009-06-28T19:11:00.001-07:00</published><updated>2009-06-28T20:01:08.108-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-28T20:01:08.108-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="JQuery" /><category scheme="http://www.blogger.com/atom/ns#" term="JQGrid" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title>JQGrid using MVC, Json and Datatable.</title><content type="html">Last couple of days i have been trying to make my sample JQGrid working ASP.NET MVC and DataTable. If you google it with this two terms MVC,JQGrid you will find lot of samples using Linq, but if you work with Databases like Oracle or any other databases which does not have a LINQ provider(atleast at the time of writing this article) your alternate choice is to go with DataSet/DataTable. So i thought of putting this example together to help others who are on the same boat like myself.&lt;br /&gt;&lt;br /&gt;I have given a fully working sample of ASP.NET MVC with JQgrid using Datatable(See below for the download link).&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_KG5zJqqvNd4/SkgnhG1UgII/AAAAAAAAAWA/2uX3bDUoDtM/s1600-h/MVC+JQGrid.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 123px;" src="http://3.bp.blogspot.com/_KG5zJqqvNd4/SkgnhG1UgII/AAAAAAAAAWA/2uX3bDUoDtM/s320/MVC+JQGrid.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5352571606853255298" /&gt;&lt;/a&gt;&lt;br /&gt;I am not going to cover the basics of MVC in this article, for which you can refer to other blogs such as &lt;a href="http://weblogs.asp.net/scottgu/archive/2009/04/28/free-asp-net-mvc-nerddinner-tutorial-now-in-html.aspx"&gt;this one&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;These are the features i have implemented in this sample, &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;   &lt;li&gt;Themes&lt;/li&gt;&lt;br /&gt;   &lt;li&gt;Refresh Grid&lt;/li&gt;&lt;br /&gt;   &lt;li&gt;Server side Paging&lt;/li&gt;&lt;br /&gt;   &lt;li&gt;Sorting&lt;/li&gt;&lt;br /&gt;   &lt;li&gt;JSON based&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;I will cover other features of JQGrid in my future articles.&lt;br /&gt;&lt;br /&gt;Here are the steps to get started,&lt;br /&gt;&lt;br /&gt;1. Download JQGrid from &lt;a href="http://www.trirand.com/blog/?page_id=6"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. Create an MVC Application using the Visual Studio 2008 template( if you want a detailed explanation for creating an MVC application VS Template refer &lt;a href="http://weblogs.asp.net/scottgu/archive/2009/04/01/asp-net-mvc-1-0.aspx"&gt;here&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;3. Now move the downloaded JQGrid files into the &lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;project&amp;gt;/scripts&lt;/span&gt;&lt;/span&gt; folders.&lt;br /&gt;&lt;br /&gt;4. Usually with MVC application people tend to put all the themes under Content folder, if you do that here you will have to modify the js files for paging  button's images.So i wouldn't recommend moving themes folder.&lt;br /&gt;&lt;br /&gt;4. Open the Site.Master inside &lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;project&amp;gt;/Shared/Site.Master&lt;/span&gt;&lt;/span&gt; and add links to the following files,&lt;br /&gt;../../Scripts/themes/steel/grid.css&lt;br /&gt;../../Scripts/themes/jqModal.css&lt;br /&gt;../../Scripts/jquery.jqGrid.js&lt;br /&gt;../../Scripts/js/jqModal.js&lt;br /&gt;../../Scripts/js/jqDnR.js&lt;br /&gt;&lt;br /&gt;5. If you don't like steel themes there 4 other themes( basic,coffee,green and sand) available inside themes folder.&lt;br /&gt;&lt;br /&gt;6. Now you site.master will look similar to this.&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;%@ Master Language=&amp;quot;C#&amp;quot; Inherits=&amp;quot;System.Web.Mvc.ViewMasterPage&amp;quot; %&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Strict//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;&amp;lt;asp:ContentPlaceHolder ID=&amp;quot;TitleContent&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;    &amp;lt;link href=&amp;quot;../../Content/Site.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;script src=&amp;quot;/Scripts/jquery-1.3.2.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;    &lt;br /&gt;    &amp;lt;script src=&amp;quot;../../Scripts/jquery-1.3.2.min.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;    &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;../../Scripts/themes/steel/grid.css&amp;quot; title=&amp;quot;steel&amp;quot;&lt;br /&gt;        media=&amp;quot;screen&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;link href=&amp;quot;../../Scripts/themes/jqModal.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;script src=&amp;quot;../../Scripts/jquery.jqGrid.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;    &amp;lt;script src=&amp;quot;../../Scripts/js/jqModal.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;    &amp;lt;script src=&amp;quot;../../Scripts/js/jqDnR.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;asp:ContentPlaceHolder ID=&amp;quot;HeadContent&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;    &amp;lt;div class=&amp;quot;page&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;div id=&amp;quot;header&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;div id=&amp;quot;title&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;h1&amp;gt;Sample from arahuman.blogspot.com&amp;lt;/h1&amp;gt;&lt;br /&gt;            &amp;lt;/div&amp;gt;&lt;br /&gt;            &amp;lt;div id=&amp;quot;logindisplay&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;% Html.RenderPartial(&amp;quot;LogOnUserControl&amp;quot;); %&amp;gt;&lt;br /&gt;            &amp;lt;/div&amp;gt; &lt;br /&gt;            &amp;lt;div id=&amp;quot;menucontainer&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;ul id=&amp;quot;menu&amp;quot;&amp;gt;              &lt;br /&gt;                    &amp;lt;li&amp;gt;&amp;lt;%= Html.ActionLink(&amp;quot;Home&amp;quot;, &amp;quot;Index&amp;quot;, &amp;quot;Home&amp;quot;)%&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;                    &amp;lt;li&amp;gt;&amp;lt;%= Html.ActionLink(&amp;quot;About&amp;quot;, &amp;quot;About&amp;quot;, &amp;quot;Home&amp;quot;)%&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;                &amp;lt;/ul&amp;gt;&lt;br /&gt;            &amp;lt;/div&amp;gt;&lt;br /&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;        &amp;lt;div id=&amp;quot;main&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;asp:ContentPlaceHolder ID=&amp;quot;MainContent&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;div id=&amp;quot;footer&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;/div&amp;gt;&lt;br /&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;7. Create a folder named Helper under the &lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;project&amp;gt;/Helper&lt;/span&gt;&lt;/span&gt; folder and add the following Helper method to convert a Datatable into the JSON format. &lt;br /&gt;&lt;pre name="code" class="c#"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Data;&lt;br /&gt;using Newtonsoft.Json;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.IO;&lt;br /&gt;&lt;br /&gt;namespace JQGridMVCDemo.Helper {&lt;br /&gt;    public class JsonHelper {&lt;br /&gt;        public static string JsonForJqgrid(DataTable dt, int pageSize, int totalRecords,int page) {&lt;br /&gt;            int totalPages = (int)Math.Ceiling((float)totalRecords / (float)pageSize);&lt;br /&gt;            StringBuilder jsonBuilder = new StringBuilder();&lt;br /&gt;            jsonBuilder.Append("{");&lt;br /&gt;            jsonBuilder.Append("\"total\":" + totalPages + ",\"page\":" + page + ",\"records\":" + (totalRecords) + ",\"rows\"");&lt;br /&gt;            jsonBuilder.Append(":[");&lt;br /&gt;            for (int i = 0; i &lt; dt.Rows.Count; i++) {&lt;br /&gt;                jsonBuilder.Append("{\"i\":"+ (i) +",\"cell\":[");&lt;br /&gt;                for (int j = 0; j &lt; dt.Columns.Count; j++) {&lt;br /&gt;                    jsonBuilder.Append("\"");&lt;br /&gt;                    jsonBuilder.Append(dt.Rows[i][j].ToString());&lt;br /&gt;                    jsonBuilder.Append("\",");&lt;br /&gt;                }&lt;br /&gt;                jsonBuilder.Remove(jsonBuilder.Length - 1, 1);&lt;br /&gt;                jsonBuilder.Append("]},");&lt;br /&gt;            }&lt;br /&gt;            jsonBuilder.Remove(jsonBuilder.Length - 1, 1);&lt;br /&gt;            jsonBuilder.Append("]");&lt;br /&gt;            jsonBuilder.Append("}");&lt;br /&gt;            return jsonBuilder.ToString();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;8. Now open the index page under &lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;project&amp;gt;/SViews/Home/Index.aspx&lt;/span&gt;&lt;/span&gt; and add the following code,&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; MasterPageFile=&amp;quot;~/Views/Shared/Site.Master&amp;quot; Inherits=&amp;quot;System.Web.Mvc.ViewPage&amp;quot; %&amp;gt;&lt;br /&gt;&amp;lt;asp:Content ID=&amp;quot;indexTitle&amp;quot; ContentPlaceHolderID=&amp;quot;TitleContent&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    Home Page&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&amp;lt;asp:Content ID=&amp;quot;indexContent&amp;quot; ContentPlaceHolderID=&amp;quot;HeadContent&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;        jQuery(document).ready(function() {&lt;br /&gt;            jQuery(&amp;quot;#list&amp;quot;).jqGrid({&lt;br /&gt;            url: '/Home/GetGridData/',&lt;br /&gt;                datatype: 'json',&lt;br /&gt;                mtype: 'GET',&lt;br /&gt;                colNames: ['Customer ID', 'Contact Name', 'Address', 'City', 'Postal Code'],&lt;br /&gt;                colModel: [&lt;br /&gt;                  { name: 'CustomerID', index: 'CustomerID', width: 100, align: 'left' },&lt;br /&gt;                  { name: 'ContactName', index: 'ContactName', width: 150, align: 'left' },&lt;br /&gt;                  { name: 'Address', index: 'Address', width: 300, align: 'left' },&lt;br /&gt;                  { name: 'City', index: 'City', width: 150, align: 'left' },&lt;br /&gt;                  { name: 'PostalCode', index: 'PostalCode', width: 100, align: 'left' }&lt;br /&gt;                ],&lt;br /&gt;                pager: jQuery('#pager'),&lt;br /&gt;                rowNum: 10,&lt;br /&gt;                rowList: [5, 10, 20, 50],&lt;br /&gt;                sortname: 'CustomerID',&lt;br /&gt;                sortorder: &amp;quot;asc&amp;quot;,&lt;br /&gt;                viewrecords: true,&lt;br /&gt;                imgpath: '/scripts/themes/steel/images',&lt;br /&gt;                caption: 'Northwind Customer Information'&lt;br /&gt;            }).navGrid(pager, { edit: false, add: false, del: false, refresh: true, search: false });&lt;br /&gt;        });&lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&amp;lt;asp:Content ID=&amp;quot;Content1&amp;quot; ContentPlaceHolderID=&amp;quot;MainContent&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;h2&amp;gt;&lt;br /&gt;        Customers List&amp;lt;/h2&amp;gt;&lt;br /&gt;    &amp;lt;table id=&amp;quot;list&amp;quot; class=&amp;quot;scroll&amp;quot; cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;/table&amp;gt;&lt;br /&gt;    &amp;lt;div id=&amp;quot;pager&amp;quot; class=&amp;quot;scroll&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;the id (#list) links the html table with the jquery to inject the grid ui's code at runtime.&lt;br /&gt;it makes an ajax calls using the &lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;url(/Home/GetGridData/)&lt;/span&gt;&lt;/span&gt; provided.&lt;br /&gt;datatype: json refers to the output from the above call returns the JSON type results.&lt;br /&gt;&lt;br /&gt;9. Now open the home controller page to add the GetGridDataMethod under &lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;project&amp;gt;/Controller/HomeController.cs&lt;/span&gt;&lt;/span&gt;. Add the following code to it.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="c#"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Mvc;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Data;&lt;br /&gt;using JQGridMVCDemo.Helper;&lt;br /&gt;&lt;br /&gt;namespace MvcApplication1.Controllers {&lt;br /&gt;    [HandleError]&lt;br /&gt;    public class HomeController : Controller {&lt;br /&gt;        public ActionResult Index() {&lt;br /&gt;            ViewData["Message"] = "Welcome to ASP.NET MVC!";&lt;br /&gt;            return View();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public ActionResult About() {&lt;br /&gt;            return View();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public ActionResult GetGridData(string sidx, string sord, int page, int rows) {&lt;br /&gt;            return Content(JsonHelper.JsonForJqgrid(GetDataTable(sidx,sord,page,rows), rows, GetTotalCount(), page), "application/json");&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public DataTable GetDataTable(string sidx, string sord, int page, int pageSize) {&lt;br /&gt;            int startIndex = (page-1) * pageSize;&lt;br /&gt;            int endIndex = page * pageSize;&lt;br /&gt;            string sql = @"WITH PAGED_CUSTOMERS  AS&lt;br /&gt;                        (&lt;br /&gt;                         SELECT  CustomerID, ContactName, Address, City, PostalCode,&lt;br /&gt;                           ROW_NUMBER() OVER (ORDER BY " + sidx + @" " + sord + @") AS RowNumber&lt;br /&gt;                         FROM CUSTOMERS&lt;br /&gt;                        )&lt;br /&gt;                        SELECT CustomerID, ContactName, Address, City, PostalCode&lt;br /&gt;                        FROM PAGED_CUSTOMERS&lt;br /&gt;                        WHERE RowNumber BETWEEN " + startIndex + @" AND " + endIndex + @";";&lt;br /&gt;                        &lt;br /&gt;            DataTable dt = new DataTable();&lt;br /&gt;            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["mainConnection"].ConnectionString);&lt;br /&gt;            SqlDataAdapter adap = new SqlDataAdapter(sql,conn);&lt;br /&gt;            var rows=adap.Fill(dt);&lt;br /&gt;            return dt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public int GetTotalCount() {&lt;br /&gt;            string sql = @"SELECT COUNT(*) FROM Customers";&lt;br /&gt;            SqlConnection conn=null;&lt;br /&gt;            try {&lt;br /&gt;                 conn= new SqlConnection(ConfigurationManager.ConnectionStrings["mainConnection"].ConnectionString);&lt;br /&gt;                SqlCommand comm = new SqlCommand(sql, conn);&lt;br /&gt;                conn.Open();&lt;br /&gt;                return (int)comm.ExecuteScalar();&lt;br /&gt;            } catch {&lt;br /&gt;            } finally {&lt;br /&gt;                try {&lt;br /&gt;                    if (ConnectionState.Closed != conn.State) {&lt;br /&gt;                        conn.Close();&lt;br /&gt;                    }&lt;br /&gt;                }catch {&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            return -1;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have declared four paramters here which will be passed by the JQuery. To help us understand better i have named it same like the JGrid where sidx refers to Sort Index name, sord refers to Sort Direction, page refers to page being invoked and rows refers to rows per page.&lt;br /&gt;&lt;br /&gt;That's it. You can download the fully functional source code &lt;a href="http://arahuman.googlepages.com/JQGridMVCDemo.zip"&gt;here&lt;/a&gt;. Enjoy and leave me a comment if you like it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-8073238388920528955?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NqE83f5xYSRh4n3vb6FhV4z3uU4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NqE83f5xYSRh4n3vb6FhV4z3uU4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NqE83f5xYSRh4n3vb6FhV4z3uU4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NqE83f5xYSRh4n3vb6FhV4z3uU4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/t0Uo7DlhHeg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/8073238388920528955/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2009/06/jqgrid-using-mvc-json-and-datatable.html#comment-form" title="10 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/8073238388920528955?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/8073238388920528955?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/t0Uo7DlhHeg/jqgrid-using-mvc-json-and-datatable.html" title="JQGrid using MVC, Json and Datatable." /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_KG5zJqqvNd4/SkgnhG1UgII/AAAAAAAAAWA/2uX3bDUoDtM/s72-c/MVC+JQGrid.png" height="72" width="72" /><thr:total>10</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2009/06/jqgrid-using-mvc-json-and-datatable.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcHRno7eSp7ImA9WxVaF08.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-1764898212165553852</id><published>2009-04-14T07:30:00.000-07:00</published><updated>2009-04-14T07:40:37.401-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-14T07:40:37.401-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oracle" /><category scheme="http://www.blogger.com/atom/ns#" term="Linq" /><title>Linq Provider for Oracle</title><content type="html">For one of my .NET project i was planning to use Linq but my database was Oracle. Microsoft Linq only supports MS-Sqlserver and Access dbs. Then i found an Open source Linq provider for Oracle. Here is the link..&lt;br /&gt;&lt;br /&gt;&lt;a href="http://code2code.net/DB_Linq/"&gt;DB_Linq(Open Source)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I have also come across another  commercial Linq provider for Oracle, which support Oracle 9 and above. Here is the link &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.mindscape.co.nz/products/LightSpeed/"&gt;Mindscape's LightSpeed&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Best of all, you can use Visual Studio 2008 to design your model like the one provided by Microsoft. They also have free express edition using which you can generate upto 8 classes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-1764898212165553852?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/znYQrmbTHv_3gvlCkv5ekBMSmsA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/znYQrmbTHv_3gvlCkv5ekBMSmsA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/znYQrmbTHv_3gvlCkv5ekBMSmsA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/znYQrmbTHv_3gvlCkv5ekBMSmsA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/i-OfaYSstX8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/1764898212165553852/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2009/04/linq-provider-for-oracle.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/1764898212165553852?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/1764898212165553852?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/i-OfaYSstX8/linq-provider-for-oracle.html" title="Linq Provider for Oracle" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2009/04/linq-provider-for-oracle.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YCRn0_eyp7ImA9WxJTFUk.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-1635700108517353563</id><published>2009-04-11T13:02:00.000-07:00</published><updated>2009-04-23T20:52:47.343-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-23T20:52:47.343-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title>Grouping Records in DataTable  or DataSet.</title><content type="html">I was working on a project where i had a requirement to group records on a dataset. The query i was using was resource intensive and i don't want to run the same query multiple times, instead i can retrieve all rows at once and then do the grouping at the datatable level. But out of the box DataSet or DataTable or Dataview don't have any way to do group by. But after Googleing i found a DataSet helper method from Microsoft which sound promising for my requirement. &lt;br /&gt;&lt;br /&gt;The only catch was it was working only with String column and it was not grouping for numeric column and i fixed that. &lt;br /&gt;&lt;br /&gt;Here is the microsoft link.&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/326145"&gt;Implement a DataSet GROUP BY Helper Class in Visual C# .NET&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is the Dataset Helper class:&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;pre name="code" class="c#"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Data;&lt;br /&gt;&lt;br /&gt;namespace DataSetHelper&lt;br /&gt;{&lt;br /&gt;    /// &lt;summary&gt;&lt;br /&gt;    /// Summary description for DataSetHelper&lt;br /&gt;    /// &lt;/summary&gt;&lt;br /&gt;    public class DataSetHelper&lt;br /&gt;    {&lt;br /&gt;        public DataSet ds;&lt;br /&gt;        private System.Collections.ArrayList m_FieldInfo; private string m_FieldList;&lt;br /&gt;        private System.Collections.ArrayList GroupByFieldInfo; private string GroupByFieldList;&lt;br /&gt;&lt;br /&gt;        public DataSetHelper(ref DataSet DataSet)&lt;br /&gt;        {&lt;br /&gt;            ds = DataSet;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public DataSetHelper()&lt;br /&gt;        {&lt;br /&gt;            ds = null;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void ParseFieldList(string FieldList, bool AllowRelation)&lt;br /&gt;        {&lt;br /&gt;            /*&lt;br /&gt;             * This code parses FieldList into FieldInfo objects  and then &lt;br /&gt;             * adds them to the m_FieldInfo private member&lt;br /&gt;             * &lt;br /&gt;             * FieldList systax:  [relationname.]fieldname[ alias], ...&lt;br /&gt;            */&lt;br /&gt;            if (m_FieldList == FieldList) return;&lt;br /&gt;            m_FieldInfo = new System.Collections.ArrayList();&lt;br /&gt;            m_FieldList = FieldList;&lt;br /&gt;            FieldInfo Field; string[] FieldParts; string[] Fields = FieldList.Split(',');&lt;br /&gt;            int i;&lt;br /&gt;            for (i = 0; i &lt;= Fields.Length - 1; i++)&lt;br /&gt;            {&lt;br /&gt;                Field = new FieldInfo();&lt;br /&gt;                //parse FieldAlias&lt;br /&gt;                FieldParts = Fields[i].Trim().Split(' ');&lt;br /&gt;                switch (FieldParts.Length)&lt;br /&gt;                {&lt;br /&gt;                    case 1:&lt;br /&gt;                        //to be set at the end of the loop&lt;br /&gt;                        break;&lt;br /&gt;                    case 2:&lt;br /&gt;                        Field.FieldAlias = FieldParts[1];&lt;br /&gt;                        break;&lt;br /&gt;                    default:&lt;br /&gt;                        throw new Exception("Too many spaces in field definition: '" + Fields[i] + "'.");&lt;br /&gt;                }&lt;br /&gt;                //parse FieldName and RelationName&lt;br /&gt;                FieldParts = FieldParts[0].Split('.');&lt;br /&gt;                switch (FieldParts.Length)&lt;br /&gt;                {&lt;br /&gt;                    case 1:&lt;br /&gt;                        Field.FieldName = FieldParts[0];&lt;br /&gt;                        break;&lt;br /&gt;                    case 2:&lt;br /&gt;                        if (AllowRelation == false)&lt;br /&gt;                            throw new Exception("Relation specifiers not permitted in field list: '" + Fields[i] + "'.");&lt;br /&gt;                        Field.RelationName = FieldParts[0].Trim();&lt;br /&gt;                        Field.FieldName = FieldParts[1].Trim();&lt;br /&gt;                        break;&lt;br /&gt;                    default:&lt;br /&gt;                        throw new Exception("Invalid field definition: " + Fields[i] + "'.");&lt;br /&gt;                }&lt;br /&gt;                if (Field.FieldAlias == null)&lt;br /&gt;                    Field.FieldAlias = Field.FieldName;&lt;br /&gt;                m_FieldInfo.Add(Field);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void ParseGroupByFieldList(string FieldList)&lt;br /&gt;        {&lt;br /&gt;            /*&lt;br /&gt;            * Parses FieldList into FieldInfo objects and adds them to the GroupByFieldInfo private member&lt;br /&gt;            * &lt;br /&gt;            * FieldList syntax: fieldname[ alias]|operatorname(fieldname)[ alias],...&lt;br /&gt;            * &lt;br /&gt;            * Supported Operators: count,sum,max,min,first,last&lt;br /&gt;            */&lt;br /&gt;            if (GroupByFieldList == FieldList) return;&lt;br /&gt;            GroupByFieldInfo = new System.Collections.ArrayList();&lt;br /&gt;            FieldInfo Field; string[] FieldParts; string[] Fields = FieldList.Split(',');&lt;br /&gt;            for (int i = 0; i &lt;= Fields.Length - 1; i++)&lt;br /&gt;            {&lt;br /&gt;                Field = new FieldInfo();&lt;br /&gt;                //Parse FieldAlias&lt;br /&gt;                FieldParts = Fields[i].Trim().Split(' ');&lt;br /&gt;                switch (FieldParts.Length)&lt;br /&gt;                {&lt;br /&gt;                    case 1:&lt;br /&gt;                        //to be set at the end of the loop&lt;br /&gt;                        break;&lt;br /&gt;                    case 2:&lt;br /&gt;                        Field.FieldAlias = FieldParts[1];&lt;br /&gt;                        break;&lt;br /&gt;                    default:&lt;br /&gt;                        throw new ArgumentException("Too many spaces in field definition: '" + Fields[i] + "'.");&lt;br /&gt;                }&lt;br /&gt;                //Parse FieldName and Aggregate&lt;br /&gt;                FieldParts = FieldParts[0].Split('(');&lt;br /&gt;                switch (FieldParts.Length)&lt;br /&gt;                {&lt;br /&gt;                    case 1:&lt;br /&gt;                        Field.FieldName = FieldParts[0];&lt;br /&gt;                        break;&lt;br /&gt;                    case 2:&lt;br /&gt;                        Field.Aggregate = FieldParts[0].Trim().ToLower();    //we're doing a case-sensitive comparison later&lt;br /&gt;                        Field.FieldName = FieldParts[1].Trim(' ', ')');&lt;br /&gt;                        break;&lt;br /&gt;                    default:&lt;br /&gt;                        throw new ArgumentException("Invalid field definition: '" + Fields[i] + "'.");&lt;br /&gt;                }&lt;br /&gt;                if (Field.FieldAlias == null)&lt;br /&gt;                {&lt;br /&gt;                    if (Field.Aggregate == null)&lt;br /&gt;                        Field.FieldAlias = Field.FieldName;&lt;br /&gt;                    else&lt;br /&gt;                        Field.FieldAlias = Field.Aggregate + "of" + Field.FieldName;&lt;br /&gt;                }&lt;br /&gt;                GroupByFieldInfo.Add(Field);&lt;br /&gt;            }&lt;br /&gt;            GroupByFieldList = FieldList;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public DataTable CreateGroupByTable(string TableName, DataTable SourceTable, string FieldList)&lt;br /&gt;        {&lt;br /&gt;            /*&lt;br /&gt;             * Creates a table based on aggregates of fields of another table&lt;br /&gt;             * &lt;br /&gt;             * RowFilter affects rows before GroupBy operation. No "Having" support&lt;br /&gt;             * though this can be emulated by subsequent filtering of the table that results&lt;br /&gt;             * &lt;br /&gt;             *  FieldList syntax: fieldname[ alias]|aggregatefunction(fieldname)[ alias], ...&lt;br /&gt;            */&lt;br /&gt;            if (FieldList == null)&lt;br /&gt;            {&lt;br /&gt;                throw new ArgumentException("You must specify at least one field in the field list.");&lt;br /&gt;                //return CreateTable(TableName, SourceTable);&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                DataTable dt = new DataTable(TableName);&lt;br /&gt;                ParseGroupByFieldList(FieldList);&lt;br /&gt;                foreach (FieldInfo Field in GroupByFieldInfo)&lt;br /&gt;                {&lt;br /&gt;                    DataColumn dc = SourceTable.Columns[Field.FieldName];&lt;br /&gt;                    if (Field.Aggregate == null)&lt;br /&gt;                        dt.Columns.Add(Field.FieldAlias, dc.DataType, dc.Expression);&lt;br /&gt;                    else&lt;br /&gt;                        dt.Columns.Add(Field.FieldAlias, dc.DataType);&lt;br /&gt;                }&lt;br /&gt;                if (ds != null)&lt;br /&gt;                    ds.Tables.Add(dt);&lt;br /&gt;                return dt;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public void InsertGroupByInto(DataTable DestTable, DataTable SourceTable, string FieldList,&lt;br /&gt;        string RowFilter, string GroupBy)&lt;br /&gt;        {&lt;br /&gt;            /*&lt;br /&gt;             * Copies the selected rows and columns from SourceTable and inserts them into DestTable&lt;br /&gt;             * FieldList has same format as CreateGroupByTable&lt;br /&gt;            */&lt;br /&gt;            if (FieldList == null)&lt;br /&gt;                throw new ArgumentException("You must specify at least one field in the field list.");&lt;br /&gt;            ParseGroupByFieldList(FieldList); //parse field list&lt;br /&gt;            ParseFieldList(GroupBy, false);   //parse field names to Group By into an arraylist&lt;br /&gt;            DataRow[] Rows = SourceTable.Select(RowFilter, GroupBy);&lt;br /&gt;            DataRow LastSourceRow = null, DestRow = null; bool SameRow; int RowCount = 0;&lt;br /&gt;            foreach (DataRow SourceRow in Rows)&lt;br /&gt;            {&lt;br /&gt;                SameRow = false;&lt;br /&gt;                if (LastSourceRow != null)&lt;br /&gt;                {&lt;br /&gt;                    SameRow = true;&lt;br /&gt;                    foreach (FieldInfo Field in m_FieldInfo)&lt;br /&gt;                    {&lt;br /&gt;                        if (!ColumnEqual(LastSourceRow[Field.FieldName], SourceRow[Field.FieldName]))&lt;br /&gt;                        {&lt;br /&gt;                            SameRow = false;&lt;br /&gt;                            break;&lt;br /&gt;                        }&lt;br /&gt;                    }&lt;br /&gt;                    if (!SameRow)&lt;br /&gt;                        DestTable.Rows.Add(DestRow);&lt;br /&gt;                }&lt;br /&gt;                if (!SameRow)&lt;br /&gt;                {&lt;br /&gt;                    DestRow = DestTable.NewRow();&lt;br /&gt;                    RowCount = 0;&lt;br /&gt;                }&lt;br /&gt;                RowCount += 1;&lt;br /&gt;                foreach (FieldInfo Field in GroupByFieldInfo)&lt;br /&gt;                {&lt;br /&gt;                    switch (Field.Aggregate)    //this test is case-sensitive&lt;br /&gt;                    {&lt;br /&gt;                        case null:        //implicit last&lt;br /&gt;                        case "":        //implicit last&lt;br /&gt;                        case "last":&lt;br /&gt;                            DestRow[Field.FieldAlias] = SourceRow[Field.FieldName];&lt;br /&gt;                            break;&lt;br /&gt;                        case "first":&lt;br /&gt;                            if (RowCount == 1)&lt;br /&gt;                                DestRow[Field.FieldAlias] = SourceRow[Field.FieldName];&lt;br /&gt;                            break;&lt;br /&gt;                        case "count":&lt;br /&gt;                            DestRow[Field.FieldAlias] = RowCount;&lt;br /&gt;                            break;&lt;br /&gt;                        case "sum":&lt;br /&gt;                            DestRow[Field.FieldAlias] = Add(DestRow[Field.FieldAlias], SourceRow[Field.FieldName]);&lt;br /&gt;                            break;&lt;br /&gt;                        case "max":&lt;br /&gt;                            DestRow[Field.FieldAlias] = Max(DestRow[Field.FieldAlias], SourceRow[Field.FieldName]);&lt;br /&gt;                            break;&lt;br /&gt;                        case "min":&lt;br /&gt;                            if (RowCount == 1)&lt;br /&gt;                                DestRow[Field.FieldAlias] = SourceRow[Field.FieldName];&lt;br /&gt;                            else&lt;br /&gt;                                DestRow[Field.FieldAlias] = Min(DestRow[Field.FieldAlias], SourceRow[Field.FieldName]);&lt;br /&gt;                            break;&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;                LastSourceRow = SourceRow;&lt;br /&gt;            }&lt;br /&gt;            if (DestRow != null)&lt;br /&gt;                DestTable.Rows.Add(DestRow);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private FieldInfo LocateFieldInfoByName(System.Collections.ArrayList FieldList, string Name)&lt;br /&gt;        {&lt;br /&gt;            //Looks up a FieldInfo record based on FieldName&lt;br /&gt;            foreach (FieldInfo Field in FieldList)&lt;br /&gt;            {&lt;br /&gt;                if (Field.FieldName == Name)&lt;br /&gt;                    return Field;&lt;br /&gt;            }&lt;br /&gt;            return null;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private bool ColumnEqual(object a, object b)&lt;br /&gt;        {&lt;br /&gt;            /*&lt;br /&gt;             * Compares two values to see if they are equal. Also compares DBNULL.Value.&lt;br /&gt;             * &lt;br /&gt;             * Note: If your DataTable contains object fields, you must extend this&lt;br /&gt;             * function to handle them in a meaningful way if you intend to group on them.&lt;br /&gt;            */&lt;br /&gt;            if ((a is DBNull) &amp;&amp; (b is DBNull))&lt;br /&gt;                return true;    //both are null&lt;br /&gt;            if ((a is DBNull) || (b is DBNull))&lt;br /&gt;                return false;    //only one is null&lt;br /&gt;            return (a.Equals(b));    //value type standard comparison&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private object Min(object a, object b)&lt;br /&gt;        {&lt;br /&gt;            //Returns MIN of two values - DBNull is less than all others&lt;br /&gt;            if ((a is DBNull) || (b is DBNull))&lt;br /&gt;                return DBNull.Value;&lt;br /&gt;            if (((IComparable)a).CompareTo(b) == -1)&lt;br /&gt;                return a;&lt;br /&gt;            else&lt;br /&gt;                return b;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private object Max(object a, object b)&lt;br /&gt;        {&lt;br /&gt;            //Returns Max of two values - DBNull is less than all others&lt;br /&gt;            if (a is DBNull)&lt;br /&gt;                return b;&lt;br /&gt;            if (b is DBNull)&lt;br /&gt;                return a;&lt;br /&gt;            if (((IComparable)a).CompareTo(b) == 1)&lt;br /&gt;                return a;&lt;br /&gt;            else&lt;br /&gt;                return b;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private object Add(object a, object b)&lt;br /&gt;        {&lt;br /&gt;            //Adds two values - if one is DBNull, then returns the other&lt;br /&gt;            if (a is DBNull)&lt;br /&gt;                return b;&lt;br /&gt;            if (b is DBNull)&lt;br /&gt;                return a;&lt;br /&gt;            return ((decimal)a + (decimal)b);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public DataTable SelectGroupByInto(string TableName, DataTable SourceTable, string FieldList,&lt;br /&gt;            string RowFilter, string GroupBy)&lt;br /&gt;        {&lt;br /&gt;            /*&lt;br /&gt;             * Selects data from one DataTable to another and performs various aggregate functions&lt;br /&gt;             * along the way. See InsertGroupByInto and ParseGroupByFieldList for supported aggregate functions.&lt;br /&gt;             */&lt;br /&gt;            DataTable dt = CreateGroupByTable(TableName, SourceTable, FieldList);&lt;br /&gt;            InsertGroupByInto(dt, SourceTable, FieldList, RowFilter, GroupBy);&lt;br /&gt;            return dt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private class FieldInfo&lt;br /&gt;        {&lt;br /&gt;            public string RelationName;&lt;br /&gt;            public string FieldName; //source table field name&lt;br /&gt;            public string FieldAlias; //destination table field name&lt;br /&gt;            public string Aggregate;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here is the sample page to test the above class,&lt;br /&gt;Create a simple aspx page with 3 grid views and use the following code behind given below,&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="c#"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Data;&lt;br /&gt;using PrintDashboard;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        DataSet ds = new DataSet();&lt;br /&gt;        DataSetHelper dsHelper = new DataSetHelper(ref ds);&lt;br /&gt;//Create the source table&lt;br /&gt;DataTable dt = new DataTable("Orders");&lt;br /&gt;dt.Columns.Add("EmployeeID", Type.GetType("System.String"));&lt;br /&gt;dt.Columns.Add("OrderID", Type.GetType("System.Int32"));&lt;br /&gt;dt.Columns.Add("Amount", Type.GetType("System.Decimal"));&lt;br /&gt;dt.Rows.Add(new object[] {"Sam", 5, 25.00});&lt;br /&gt;dt.Rows.Add(new object[] {"Tom", 7, 50.00});&lt;br /&gt;dt.Rows.Add(new object[] {"Sue", 9, 11.00});&lt;br /&gt;dt.Rows.Add(new object[] {"Tom", 12, 7.00});&lt;br /&gt;dt.Rows.Add(new object[] {"Sam", 14, 512.00});&lt;br /&gt;dt.Rows.Add(new object[] {"Sue", 15, 17.00});&lt;br /&gt;dt.Rows.Add(new object[] {"Sue", 22, 2.50});&lt;br /&gt;dt.Rows.Add(new object[] {"Tom", 24, 3.00});&lt;br /&gt;dt.Rows.Add(new object[] {"Tom", 33, 78.75});&lt;br /&gt;ds.Tables.Add(dt);&lt;br /&gt;        this.GridView1.DataSource = ds;&lt;br /&gt;        &lt;br /&gt;dsHelper.CreateGroupByTable("OrderSummary", ds.Tables["Orders"], &lt;br /&gt; "EmployeeID,count(EmployeeID) Orders,Sum(Amount) OrderTotal,max(Amount) BestOrder,min(Amount) WorstOrder");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;dsHelper.InsertGroupByInto(ds.Tables["OrderSummary"], ds.Tables["Orders"], &lt;br /&gt;    "EmployeeID,count(EmployeeID) Orders,sum(Amount) OrderTotal,max(Amount) BestOrder,min(Amount) WorstOrder", &lt;br /&gt;    "", "EmployeeID");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        this.GridView2.DataSource= dt1;&lt;br /&gt;        this.GridView2.DataBind();&lt;br /&gt;        this.GridView1.DataBind();&lt;br /&gt;        DataTable dt2;&lt;br /&gt;        dt2 = dsHelper.SelectGroupByInto("OrderSummary2", ds.Tables["Orders"], &lt;br /&gt;    "EmployeeID,count(EmployeeID) Orders,sum(Amount) OrderTotal,max(Amount) BestOrder,min(Amount) WorstOrder", &lt;br /&gt;    "OrderID&gt;10", "EmployeeID");&lt;br /&gt;        this.GridView3.DataSource = dt2;&lt;br /&gt;        this.GridView3.DataBind();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-1635700108517353563?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CwHd49Oz6b3D-S7S9ofSaDpx4kY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CwHd49Oz6b3D-S7S9ofSaDpx4kY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CwHd49Oz6b3D-S7S9ofSaDpx4kY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CwHd49Oz6b3D-S7S9ofSaDpx4kY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/8JNB0i7g5kA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/1635700108517353563/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2009/04/grouping-records-in-datatable-or.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/1635700108517353563?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/1635700108517353563?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/8JNB0i7g5kA/grouping-records-in-datatable-or.html" title="Grouping Records in DataTable  or DataSet." /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2009/04/grouping-records-in-datatable-or.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQNQX0_fSp7ImA9WxVUGUQ.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-3118872066594577192</id><published>2009-03-24T20:11:00.000-07:00</published><updated>2009-03-25T07:13:10.345-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-25T07:13:10.345-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WPF" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET 3.5" /><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight" /><title>WPF(Windows Presentation Foundation) Introduction</title><content type="html">&lt;a href="http://silverlight.net/showcase (silverlight showcase)"&gt;&lt;/a&gt;If you are new to WPF(Window Presentation Foundation) you can use the following links  to learn this new technology. The video link given below is not a tutorial but will highlight the features of this new technology.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://wm.microsoft.com/ms/expression/wpf/WPFMKT_FINAL.wmv"&gt;Windows Presentation Foundation features- Video&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can use these other links to learn this new great technology.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa480221.aspx"&gt;A Guided Tour of Windows Presentation Foundation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa663364.aspx"&gt;Introducing Windows Presentation Foundation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa480192.aspx"&gt;An Introduction to Windows Presentation Foundation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you want learn the Silverlight Architecture you can use the following MSDN link to learn more.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb404713(VS.95).aspx"&gt;Silverlight Architecture&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Use the following link to see of the silverlight samples.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://silverlight.net/showcase"&gt;Silverlight Samples&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope you will enjoy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-3118872066594577192?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xt1tNZoAdNrKUq0JOOoa4uT4m6Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xt1tNZoAdNrKUq0JOOoa4uT4m6Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xt1tNZoAdNrKUq0JOOoa4uT4m6Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xt1tNZoAdNrKUq0JOOoa4uT4m6Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/F0OuipI9TkY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/3118872066594577192/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2009/03/wpfwindows-presentation-foundation.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/3118872066594577192?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/3118872066594577192?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/F0OuipI9TkY/wpfwindows-presentation-foundation.html" title="WPF(Windows Presentation Foundation) Introduction" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2009/03/wpfwindows-presentation-foundation.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0ICRXwyeCp7ImA9WxVUFk0.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-163906829367303499</id><published>2009-03-13T18:36:00.001-07:00</published><updated>2009-03-20T21:26:04.290-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-20T21:26:04.290-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title>'System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' acceptin</title><content type="html">&lt;p&gt;When i try to run a MVC Sample application from Web i was getting this &amp;quot;&lt;strong&gt;&lt;u&gt;'System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.Mvc.HtmlHelper'&lt;/u&gt;&lt;/strong&gt; could be found.&amp;quot; error. &lt;/p&gt;  &lt;p&gt;After further research i found that i was running &lt;strong&gt;&amp;quot;MVC Preview Release&amp;quot;&lt;/strong&gt; on my system, which does not support System.Web.Mvc.Html namespace. So i upgraded my MVC from my preview release to &lt;strong&gt;&amp;quot;MVC 1.0 RC2&amp;quot;.&lt;/strong&gt;&amp;#160; RC2 release can be downloaded from &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ee4b2e97-8a72-449a-82d2-2f720d421031&amp;amp;displaylang=en" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-163906829367303499?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dQ3-LiYWBDs2hPMPPbWoZNPp3jI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dQ3-LiYWBDs2hPMPPbWoZNPp3jI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dQ3-LiYWBDs2hPMPPbWoZNPp3jI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dQ3-LiYWBDs2hPMPPbWoZNPp3jI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/JzcjofcQ5Sc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/163906829367303499/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2009/03/does-not-contain-definition-for-and-no.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/163906829367303499?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/163906829367303499?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/JzcjofcQ5Sc/does-not-contain-definition-for-and-no.html" title="&amp;#39;System.Web.Mvc.HtmlHelper&amp;#39; does not contain a definition for &amp;#39;RenderPartial&amp;#39; and no extension method &amp;#39;RenderPartial&amp;#39; acceptin" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2009/03/does-not-contain-definition-for-and-no.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IMQH89fyp7ImA9WxVUFk0.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-3570697774249379785</id><published>2009-03-02T13:40:00.001-08:00</published><updated>2009-03-20T21:26:21.167-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-20T21:26:21.167-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ADO.NET" /><title>ADO.NET Entity Framework</title><content type="html">Interested in creating an N Layered application, then you might be interested in using ADO.NET's new Entity Framework. Its free. It basically creates you the Data Access Layer once you connect to your Database. Right now it supports only SQL server, but they have released a sample Framework for Oracle as well. If you want to learn more use the following links below.   &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb386876.aspx" target="_blank"&gt;Getting started with Entity Framework&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://code.msdn.microsoft.com/EFOracleProvider" target="_blank"&gt;Sample Entity Framework Provider for Oracle&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Another interesting link i have come across in this title is&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotnetslackers.com/articles/ado_net/Managing-Entity-Framework-ObjectContext-lifespan-and-scope-in-n-layered-ASP-NET-applications.aspx" target="_blank"&gt;Managing Entity Framework ObjectContext lifespan and scope in n-layered ASP.NET applications&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Hope you will find this useful.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-3570697774249379785?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/urtc3vW7OdfqAVSwV84g571LCsc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/urtc3vW7OdfqAVSwV84g571LCsc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/urtc3vW7OdfqAVSwV84g571LCsc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/urtc3vW7OdfqAVSwV84g571LCsc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/H6ksef2ZaJc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/3570697774249379785/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2009/03/adonet-entity-framework.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/3570697774249379785?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/3570697774249379785?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/H6ksef2ZaJc/adonet-entity-framework.html" title="ADO.NET Entity Framework" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2009/03/adonet-entity-framework.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0ECSX4_fip7ImA9WxVUFk0.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-5992403559466552717</id><published>2009-02-23T15:01:00.001-08:00</published><updated>2009-03-20T21:27:48.046-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-20T21:27:48.046-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JQuery" /><title>Error updating JScript IntelliSense: jquery-1.3-vsdoc.js: 'jQuery.support.htmlSerialize' is null or not an object @ 1416:4</title><content type="html">&lt;p&gt;Even after adding the IntelliSense file for JQuery, you might still get an error as below,&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&amp;quot;Error updating JScript IntelliSense: jquery-1.3-vsdoc.js: 'jQuery.support.htmlSerialize' is null or not an object @ 1416:4&amp;quot;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Atleast in my case the reason was, i was using a JQuery-UI library and it was due to a conflict between the JQuery and JQuery-UI library. The first workaround i did was create an empty file for the Jquery-UI library with the extension -vsdoc.js or you can create your own intelliSense file.&lt;/p&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-5992403559466552717?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lDzJ4gP2d45pi3V5hZk4dJFOfiE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lDzJ4gP2d45pi3V5hZk4dJFOfiE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lDzJ4gP2d45pi3V5hZk4dJFOfiE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lDzJ4gP2d45pi3V5hZk4dJFOfiE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/gc-PbRcJk7c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/5992403559466552717/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2009/02/error-updating-jscript-intellisense.html#comment-form" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/5992403559466552717?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/5992403559466552717?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/gc-PbRcJk7c/error-updating-jscript-intellisense.html" title="Error updating JScript IntelliSense: jquery-1.3-vsdoc.js: &amp;#39;jQuery.support.htmlSerialize&amp;#39; is null or not an object @ 1416:4" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>7</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2009/02/error-updating-jscript-intellisense.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EBRHs5fyp7ImA9WxVUFk0.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-1762608009443465064</id><published>2009-02-23T13:59:00.001-08:00</published><updated>2009-03-20T21:27:35.527-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-20T21:27:35.527-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JQuery" /><title>"Error updating JScript IntelliSense: jquery.js: Object doesn't support this property or method" Intellisense error with JQuery and Visu</title><content type="html">&lt;p&gt;If you are using JQuery, you probably won't be getting any intellisense from Visual Studio 2008. But as part of ASP.NET MVC Microsoft started shipping JQuery. In order to make the Intellisense work follow the steps that i have tried,&lt;/p&gt;  &lt;p&gt;1. Install the SP1 patch for your Visual Studio 2008. You can download the patch for free from &lt;a href="http://msdn.microsoft.com/en-us/vstudio/cc533448.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;2. Download the install the patch that recognizes the -vsdoc.js intellisense files from &lt;a href="http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;3. Download the vsdoc.js files from &lt;a href="http://docs.jquery.com/Downloading_jQuery#Download_jQuery" target="_blank"&gt;here&lt;/a&gt; and drop it along with your Jquery-x.x.js files.&lt;/p&gt;  &lt;p&gt;4. To refresh the Intellisense from within our IDE you can use CTRL+SHIFT+J.&lt;/p&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-1762608009443465064?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uX5m6NfHgKCCW-lnFsKRB-8FHBY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uX5m6NfHgKCCW-lnFsKRB-8FHBY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uX5m6NfHgKCCW-lnFsKRB-8FHBY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uX5m6NfHgKCCW-lnFsKRB-8FHBY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/NAqIK-InplA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/1762608009443465064/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2009/02/updating-jscript-intellisense-jqueryjs.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/1762608009443465064?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/1762608009443465064?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/NAqIK-InplA/updating-jscript-intellisense-jqueryjs.html" title="&amp;quot;Error updating JScript IntelliSense: jquery.js: Object doesn&amp;#39;t support this property or method&amp;quot; Intellisense error with JQuery and Visu" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2009/02/updating-jscript-intellisense-jqueryjs.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QCRHs7eip7ImA9WxVaGE0.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-2760092020248882358</id><published>2009-02-12T21:17:00.001-08:00</published><updated>2009-04-15T07:22:45.502-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-15T07:22:45.502-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ADO.NET 2.0" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title>ObjectDataSource - Selectcount method with custom parameters and custom paging.</title><content type="html">&lt;p&gt;On one of my project i was using ObjectDataSource with several parameters. I had a business logic layer with a method (For eg. GetProducts) which returns the actual recordset to be displayed also i had some logic to calculate the total records within the same method and i was populating a private member. I had a separate method to return the count from the private member and this method takes no parameter.&lt;/p&gt; &lt;br /&gt;For e.g.&lt;br /&gt;&lt;pre name="code" class="c#"&gt;&lt;br /&gt;public class ProductLogic &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;private int rowCount;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public IList&amp;lt;Product&amp;gt;GetProducts(string filter, int maxRows, int startIndex) &lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;... &lt;br /&gt;&amp;nbsp;&amp;nbsp;rowCount = 'logic to populate the count&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;public int GetProductCount() &lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return rowCount;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; &lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;p&gt;My ObjectDataSource declaration is...&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="c#"&gt;&lt;br /&gt;&amp;lt;asp:ObjectDataSource ID=&amp;quot;ObjectDataSource1&amp;quot; runat=&amp;quot;server&amp;quot; &lt;br /&gt;&lt;br /&gt;        SelectMethod=&amp;quot;GetProducts&amp;quot;&lt;br /&gt;        TypeName=&amp;quot;ProductLogic&amp;quot; SelectCountMethod=&amp;quot;GetProductCount&amp;quot; EnablePaging=&amp;quot;true&amp;quot;&lt;br /&gt;        OnSelecting=&amp;quot;Obds_Selecting&amp;quot;&lt;br /&gt;        SortParameterName=&amp;quot;sortExpression&amp;quot; &lt;br /&gt;        &amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The problem i was facing was whenever objectdatasource makes a call to the &amp;quot;GetProductCount&amp;quot; method it was expecting me to pass all the parameters like &amp;quot;GetProducts&amp;quot;. I did a Google Search but i couldn't find any information. So I did the following working around,&lt;br /&gt;&lt;br /&gt;There is a ExecutingSelectCount property you can use to decide whether the ObjectDataSource is getting the list or the count. So using this property whenever it makes call to your count method just clear out your inputparameter collection and you should be good to go. So my CodeBehind looks like this...&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="c#"&gt;&lt;br /&gt;protected void obds_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;if (!e.ExecutingSelectCount)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;e.InputParameters[&amp;quot;filter&amp;quot;] = ....;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;e.InputParameters.Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Let me know if you still have any issues i will try my best to answer it.&lt;/p&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-2760092020248882358?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rcGvL705SafYqAFsoHeocbhmiFs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rcGvL705SafYqAFsoHeocbhmiFs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rcGvL705SafYqAFsoHeocbhmiFs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rcGvL705SafYqAFsoHeocbhmiFs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/SLTKYRhBALo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/2760092020248882358/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2009/02/objectdatasource-selectcount-method.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/2760092020248882358?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/2760092020248882358?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/SLTKYRhBALo/objectdatasource-selectcount-method.html" title="ObjectDataSource - Selectcount method with custom parameters and custom paging." /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2009/02/objectdatasource-selectcount-method.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0ANQXk8cSp7ImA9WxVUFk0.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-1922087512983941799</id><published>2008-12-04T20:04:00.001-08:00</published><updated>2009-03-20T21:29:50.779-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-20T21:29:50.779-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Chart" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title>New Charting Control from Microsoft for .net framework 3.5</title><content type="html">&lt;p&gt;Microsoft has recently released a ASP.NET charting control for .NET Framework 3.5 SP1.&amp;#160; The good thing about this control is, it is FREE.&amp;#160; Once installed it can be easily used as a Server control like any other Microsoft controls. It supports a wide variety of charts like, Pie, Area, Doughnut, Point, Range , Circular, Accumulation, Data Distribution, Price Change and Advanced Financial Charts. Once you install the working sample, you will get a feel of all above mentioned chart types. The sample project includes almost 200 pages with various chart types.&lt;/p&gt;  &lt;p&gt;As far as the data, either you can specify the data while declaring the control on the HTML or you can dynamically assign the data on the code behind using the data binding techniques.&amp;#160; At runtime charting engine renders the chart as a PNG image and it is referenced from the HTML using the &amp;lt;img&amp;gt; tag. If you want to make it interactive, use these chart control in combination with AJAX. You will also find some samples around the interactive charts using AJAX in the samples projects. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You can use following links to learn and download,&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=130f7986-bf49-4fe5-9ca8-910ae6ea442c&amp;amp;DisplayLang=en" target="_blank"&gt;Download Microsoft Chart Controls(FREE)&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://code.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=1591" target="_blank"&gt;Download Samples Environment for Microsoft Chart Controls&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=EE8F6F35-B087-4324-9DBA-6DD5E844FD9F&amp;amp;displaylang=en" target="_blank"&gt;Download the Chart Control Documentation&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If you have any question don't forget to visit the Chart Control Forum.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/threads/" target="_blank"&gt;Visit the Chart Control Forum&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To give an idea of how these controls looks i have attached few snapshots from the samples project.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_KG5zJqqvNd4/STioPas2SAI/AAAAAAAAAUM/E7va_MqzCpk/snap001%5B2%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="183" alt="Microsoft Free Bar Chart" src="http://lh5.ggpht.com/_KG5zJqqvNd4/STioPvFmnTI/AAAAAAAAAUU/17PAkjSrQmw/snap001_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_KG5zJqqvNd4/STioQl1rW7I/AAAAAAAAAUY/HbE8dWRtdVU/snap002%5B2%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="183" alt="Microsoft Free Line Chart" src="http://lh3.ggpht.com/_KG5zJqqvNd4/STioQ9BziUI/AAAAAAAAAUc/_3Jm9Dz10C8/snap002_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_KG5zJqqvNd4/STioR7RpTqI/AAAAAAAAAUg/ipfWjDOJDb0/snap003%5B3%5D.jpg" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="183" alt="Microsoft Free Area Chart" src="http://lh5.ggpht.com/_KG5zJqqvNd4/STioSPTohEI/AAAAAAAAAUk/n23KZyNh2Wo/snap003_thumb%5B1%5D.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_KG5zJqqvNd4/STioS9iGaII/AAAAAAAAAUo/Ag8kBSo9zLQ/snap004%5B4%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="183" alt="Microsoft Free Pie Chart Samples" src="http://lh6.ggpht.com/_KG5zJqqvNd4/STioTdMAcUI/AAAAAAAAAUs/t5ITQVe6Kd0/snap004_thumb%5B2%5D.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Have Fun with the Free chart controls and Good luck.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-1922087512983941799?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/469t9tlw732MHDKHeFj1Q6lkL4I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/469t9tlw732MHDKHeFj1Q6lkL4I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/469t9tlw732MHDKHeFj1Q6lkL4I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/469t9tlw732MHDKHeFj1Q6lkL4I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/DzMYVJfSedk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/1922087512983941799/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2008/12/new-charting-control-from-microsoft-for.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/1922087512983941799?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/1922087512983941799?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/DzMYVJfSedk/new-charting-control-from-microsoft-for.html" title="New Charting Control from Microsoft for .net framework 3.5" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_KG5zJqqvNd4/STioPvFmnTI/AAAAAAAAAUU/17PAkjSrQmw/s72-c/snap001_thumb.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2008/12/new-charting-control-from-microsoft-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QHR385fip7ImA9WxRWGEw.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-8715915607826042558</id><published>2008-11-04T07:08:00.001-08:00</published><updated>2008-11-04T07:08:56.126-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-04T07:08:56.126-08:00</app:edited><title>Microsoft's Cloud Service - Azure</title><content type="html">&lt;p&gt;Microsoft has just released their version of cloud services like Amazon's S3, SimpleDB, Google's App Engine, etc...&amp;#160; called Azure Services Platform. It is still in beta. As per Microsoft Azure Services are available without charge during Community Technology Preview (CTP).&lt;/p&gt;  &lt;p&gt;To learn more go to Azure's site &lt;a title="http://www.microsoft.com/azure/default.mspx" href="http://www.microsoft.com/azure/default.mspx"&gt;http://www.microsoft.com/azure/default.mspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;To play with this new services download the corresponding SDK from &lt;a title="http://www.microsoft.com/azure/sdk.mspx" href="http://www.microsoft.com/azure/sdk.mspx"&gt;http://www.microsoft.com/azure/sdk.mspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;They also have a training kit available here&amp;#160; &lt;a title="http://www.microsoft.com/azure/trainingkit.mspx" href="http://www.microsoft.com/azure/trainingkit.mspx"&gt;http://www.microsoft.com/azure/trainingkit.mspx&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-8715915607826042558?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WrJKP8v05FZRoo-uhiB3sWywoQ4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WrJKP8v05FZRoo-uhiB3sWywoQ4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WrJKP8v05FZRoo-uhiB3sWywoQ4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WrJKP8v05FZRoo-uhiB3sWywoQ4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/WItEmVbHEKg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/8715915607826042558/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2008/11/microsoft-cloud-service-azure.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/8715915607826042558?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/8715915607826042558?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/WItEmVbHEKg/microsoft-cloud-service-azure.html" title="Microsoft&amp;#39;s Cloud Service - Azure" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2008/11/microsoft-cloud-service-azure.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08FQHc4eyp7ImA9WxVUFk0.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-7112631037512206711</id><published>2008-09-24T10:53:00.001-07:00</published><updated>2009-03-20T21:30:11.933-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-20T21:30:11.933-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Chart" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title>Google Chart API control for ASP.NET</title><content type="html">&lt;p&gt;If you want to use charts in your web application, you should spend some time with Google chart api's. Very simple to use.&amp;#160; I also found an open source project which implements the google chart api as ASP.NET server control.&lt;/p&gt;  &lt;p&gt;Here is the link to the Google chart API.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://code.google.com/apis/chart/" href="http://code.google.com/apis/chart/"&gt;http://code.google.com/apis/chart/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here is the link to the ASP.NET Google Chart Control.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.codeplex.com/GoogleChartNet" href="http://www.codeplex.com/GoogleChartNet"&gt;http://www.codeplex.com/GoogleChartNet&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I also found another interesting flash based open source chart project(OpenFlashChart) and here is the link to it,&lt;/p&gt;  &lt;p&gt;&lt;a title="http://teethgrinder.co.uk/open-flash-chart/" href="http://teethgrinder.co.uk/open-flash-chart/"&gt;http://teethgrinder.co.uk/open-flash-chart/&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-7112631037512206711?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8vlxTw_c2dGHlRJsU2YWO0Oh-GM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8vlxTw_c2dGHlRJsU2YWO0Oh-GM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8vlxTw_c2dGHlRJsU2YWO0Oh-GM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8vlxTw_c2dGHlRJsU2YWO0Oh-GM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/8T9137Ce8sk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/7112631037512206711/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2008/09/google-chart-api-control-for-aspnet.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/7112631037512206711?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/7112631037512206711?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/8T9137Ce8sk/google-chart-api-control-for-aspnet.html" title="Google Chart API control for ASP.NET" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2008/09/google-chart-api-control-for-aspnet.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcMR386fCp7ImA9WxVUFkw.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-6850100635723785238</id><published>2008-09-19T08:45:00.001-07:00</published><updated>2009-03-20T22:08:06.114-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-20T22:08:06.114-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title>System.MethodAccessException - System.Data.Common.DataRecordInternal.get_Item(System.String)</title><content type="html">&lt;p&gt;Ever wondered what this exception is? I ran into this issue last week when i deployed my code in a shared hosting environment which was running in Medium trust. It was working fine on my local. After some research i found that this error was thrown by a Repeater control on a page whose datasource was a datareader. In a Medium trust environment, according to microsoft &amp;quot;Reflection is not allowed&amp;quot;. Looks like when you assign a datareader to a repeater control internally it is doing some reflection which is causing this issue. Another strange behaviour with this error is it won't even tell you the exact error, instead it will be displaying something like this in a shared hosting,&lt;/p&gt;  &lt;div class='codeview'&gt;Security Exception&lt;p&gt;Description:&lt;/p&gt;&lt;p&gt;The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.&lt;/p&gt;&lt;p&gt; &lt;br /&gt;Exception Details: System.Security.SecurityException: Request failed.&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;So how will you reproduce this error locally, there is setting you can add it to your web.config&lt;/p&gt;&lt;br /&gt;&lt;div class='codeview'&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;trust level="Medium" /&amp;gt;&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;So the workaround i have found for this issue is to use dataset instead on datareader. Let me know if you guys have found a different solution.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-6850100635723785238?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7PZDENfcVBgrH5XQF1FCAsJoeTA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7PZDENfcVBgrH5XQF1FCAsJoeTA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7PZDENfcVBgrH5XQF1FCAsJoeTA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7PZDENfcVBgrH5XQF1FCAsJoeTA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/lfU5RLuS6RI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/6850100635723785238/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2008/09/systemmethodaccessexception.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/6850100635723785238?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/6850100635723785238?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/lfU5RLuS6RI/systemmethodaccessexception.html" title="System.MethodAccessException - System.Data.Common.DataRecordInternal.get_Item(System.String)" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2008/09/systemmethodaccessexception.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4MRn8yeyp7ImA9WxVUFkw.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-3718369162529502744</id><published>2008-09-03T11:36:00.001-07:00</published><updated>2009-03-20T21:49:47.193-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-20T21:49:47.193-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Build Automation" /><title>Continuous Integration</title><content type="html">&lt;p&gt;If you want to automate your build process then you are in the right spot. Continuous Integration is a process of automating the build process from various source control system. We have lot of free Continuous Integration servers in the market today. Here are few,&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET" target="_blank"&gt;CruiseControl.NET&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://cifactory.org/joomla/" target="_blank"&gt;CI Factory&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.jetbrains.com/teamcity/" target="_blank"&gt;Team City&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;My favorite is CI Factory. These CI servers can talk with variety of source control system like Visual Source Safe, Subversion, CVS, Vault and VSTS Version Control.&lt;/p&gt;&lt;p&gt;They also support various plugins like &lt;strong&gt;NCover&lt;/strong&gt;(&lt;em&gt;Collects code coverage information&lt;/em&gt;), &lt;strong&gt;nDepend&lt;/strong&gt;(&lt;em&gt;Calculates code quality metrics&lt;/em&gt;), &lt;strong&gt;Simian&lt;/strong&gt; (&lt;em&gt;Detects copy and paste duplication&lt;/em&gt;), &lt;strong&gt;NUnit&lt;/strong&gt; (&lt;strong&gt; &lt;/strong&gt;&lt;em&gt;Unit testing&lt;/em&gt;).&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-3718369162529502744?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QgcO4XrL3mJi1daobEAlwGsZeEI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QgcO4XrL3mJi1daobEAlwGsZeEI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QgcO4XrL3mJi1daobEAlwGsZeEI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QgcO4XrL3mJi1daobEAlwGsZeEI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/Lv17PKTLp3Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/3718369162529502744/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2008/09/continuous-integration.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/3718369162529502744?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/3718369162529502744?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/Lv17PKTLp3Y/continuous-integration.html" title="Continuous Integration" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2008/09/continuous-integration.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04FSHY9eyp7ImA9WxVUFk0.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-7960510721181473450</id><published>2008-08-27T09:57:00.001-07:00</published><updated>2009-03-20T21:31:59.863-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-20T21:31:59.863-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><category scheme="http://www.blogger.com/atom/ns#" term="SEO" /><title>User friendly URL in ASP.NET and SEO Page Rank</title><content type="html">&lt;p&gt;When you submit your Sitemap to the popular search engines like Google,Yahoo and MSN, make sure that your URL's are user friendly and easy to remember. URLs that are long with tracking id's and session id's might reduce the chance of user selecting the URL. Google also reduces the page rank for URL's with multiple query string parameters. &lt;/p&gt;&lt;p&gt;So we need a way to rewrite the URL from,&lt;/p&gt;&lt;p&gt;For e.g: &lt;a href="http://www.ezsmartads.com"&gt;www.ezsmartads.com/products/productlist.aspx?id=1&amp;amp;store=yes&amp;amp;cat=2&amp;amp;name=sem&lt;/a&gt;&lt;/p&gt;&lt;p&gt;to &lt;a href="http://www.ezsmartads.com"&gt;www.ezsmartads.com/products/sem.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;With an open source library called &lt;a href="http://urlrewriter.net/" target="_blank"&gt;URL Rewriter&lt;/a&gt; you can achieve this in ASP.NET.&lt;/p&gt;&lt;p&gt;I will cover a sample in my next blog.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-7960510721181473450?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8pc1sG80rGuonmMeRZfIdyL-X7Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8pc1sG80rGuonmMeRZfIdyL-X7Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8pc1sG80rGuonmMeRZfIdyL-X7Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8pc1sG80rGuonmMeRZfIdyL-X7Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/LVEuicHVjjo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/7960510721181473450/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2008/08/user-friendly-url-in-aspnet-and-seo.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/7960510721181473450?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/7960510721181473450?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/LVEuicHVjjo/user-friendly-url-in-aspnet-and-seo.html" title="User friendly URL in ASP.NET and SEO Page Rank" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2008/08/user-friendly-url-in-aspnet-and-seo.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AHQHg-eCp7ImA9WxVaGE0.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-4164259291164624770</id><published>2008-08-20T07:56:00.001-07:00</published><updated>2009-04-15T07:28:51.650-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-15T07:28:51.650-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title>How to get current node's depth from a Sitemap in ASP.NET2.0?</title><content type="html">&lt;p&gt;If you are using treecontrol or menucontrol in ASP.NET 2.0, you can achieve this easily using the built in property. &lt;/p&gt;  &lt;p&gt;While i was working on a custom navigation tree control, i wanted to get the depth of the current node from the root. By default ASP.NET 2.0 does not have a property to get the depth. So i wrote a neat little recursion which will calculate the depth for you.&lt;/p&gt;  &lt;br /&gt;&lt;pre name="code" class="vb"&gt;&lt;br /&gt;Private Function GetDepth(ByVal current As SiteMapNode) As Integer&lt;br /&gt;&amp;nbsp;&amp;nbsp;If(Not current.ParentNode Is Nothing) Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Return GetDepth(current.ParentNode) + 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Return 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;End If&lt;br /&gt;End Function&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-4164259291164624770?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lRIOxD3DGyYwsBPPF67G0sPTEkI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lRIOxD3DGyYwsBPPF67G0sPTEkI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lRIOxD3DGyYwsBPPF67G0sPTEkI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lRIOxD3DGyYwsBPPF67G0sPTEkI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/TSaVHBLOcmQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/4164259291164624770/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2008/08/how-to-get-current-node-depth-from.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/4164259291164624770?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/4164259291164624770?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/TSaVHBLOcmQ/how-to-get-current-node-depth-from.html" title="How to get current node&amp;#39;s depth from a Sitemap in ASP.NET2.0?" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2008/08/how-to-get-current-node-depth-from.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EAQ3szeCp7ImA9WxVaGE0.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-3765692305375675419</id><published>2008-08-17T09:53:00.001-07:00</published><updated>2009-04-15T07:27:22.580-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-15T07:27:22.580-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Search Engine Optimization" /><category scheme="http://www.blogger.com/atom/ns#" term="Meta Tags" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title>ASP.NET - Master pages and Search Engine Optimization:</title><content type="html">&lt;p&gt;We all know that asp.net have simplified our life with the introduction of master pages. but what about the Search engine optimization?&lt;/p&gt;&lt;p&gt;How do we handle that. Here are few tips for you to make your asp.net site Search engine friendly.. &lt;/p&gt;&lt;p&gt;&lt;strong&gt;1. TITLE tags.&lt;br /&gt;&lt;/strong&gt;   First important factor that affects your Page rank is your page's title. If you use the title tag on the master page and ignore the title attribute on child page's PAGE directive, Google bot will think all your pages are same and it will either reduce your page rank or will ignore it.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;So always use the Child page's TITLE Attribute. There are multiple ways you can archive this, &lt;/p&gt;&lt;p&gt;&lt;strong&gt;1.  From ASPX Page:&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;VB.NET :&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre name="code" class="vb"&gt;&lt;br /&gt;&amp;lt;%@ Page Language="VB" MasterPageFile="~/Default.master" AutoEventWireup="false"&lt;br /&gt;    CodeFile="Default.aspx.vb" Inherits="ezSmartAds.Home" Title="Website Promotion -Improve ROI" %&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;C# :&lt;/strong&gt;&lt;br /&gt;&lt;pre name="code" class="c#"&gt;&lt;br /&gt;protected void Page_Load(object sender, System.EventArgs e)  &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.Page.Title = "Website Promotion -Improve ROI"; &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;VB.NET:&lt;/strong&gt; &lt;/p&gt;&lt;br /&gt;&lt;pre name="code" class="vb"&gt;&lt;br /&gt;Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Me.Page.Title = "Website Promotion -Improve ROI"\&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;2. META Tags:&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;   Second important factor is your Meta tags. When users search's on a search engine, Meta description is the one which encourages your users to click on your site.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Here is the explanation from Google on Meta Description: &lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;"Differentiate the descriptions for different pages. Using identical or similar descriptions on every page of a site isn't very helpful when individual pages appear in the web results. In these cases we're less likely to display the boilerplate text. Wherever possible, create descriptions that accurately describe the specific page. Use site-level descriptions on the main home page or other aggregation pages, and use page-level descriptions everywhere else. If you don't have time to create a description for every single page, try to prioritize your content: At the very least, create a description for the critical URLs like your home page and popular pages." &lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;Here is the sample code to add meta tags from code behind.&lt;br /&gt;&lt;p&gt;&lt;strong&gt;From Code behind:&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;VB.NET :&lt;/strong&gt;&lt;br /&gt;&lt;pre name="code" class="vb"&gt;&lt;br /&gt;Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;&amp;nbsp;&amp;nbsp;Dim metaTagAuthor As HtmlMeta = New HtmlMeta&lt;br /&gt;&amp;nbsp;&amp;nbsp;Dim metaTagKeywords As HtmlMeta = New HtmlMeta&lt;br /&gt;&amp;nbsp;&amp;nbsp;Dim metaTagDescription As HtmlMeta = New HtmlMeta&lt;br /&gt;&amp;nbsp;&amp;nbsp;metaTagAuthor.Name = "Author"&lt;br /&gt;&amp;nbsp;&amp;nbsp;metaTagAuthor.Content = "Your Name" 'Add your name here&lt;br /&gt;&amp;nbsp;&amp;nbsp;metaTagKeywords.Name = "Keywords"&lt;br /&gt;&amp;nbsp;&amp;nbsp;metaTagKeywords.Content = "" 'Add all your keywords here&lt;br /&gt;&amp;nbsp;&amp;nbsp;metaTagDescription.Name = "Description"&lt;br /&gt;&amp;nbsp;&amp;nbsp;metaTagDescription.Content = "" 'Add you webpage's description here&lt;br /&gt;&amp;nbsp;&amp;nbsp;Me.Page.Header.Controls.Add(metaTagAuthor)&lt;br /&gt;&amp;nbsp;&amp;nbsp;Me.Page.Header.Controls.Add(metaTagKeywords)&lt;br /&gt;&amp;nbsp;&amp;nbsp;Me.Page.Header.Controls.Add(metaTagDescription)&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;C#:&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre name="code" class="c#"&gt;&lt;br /&gt;protected void Page_Load(object&lt;/span&gt; sender, System.EventArgs e) &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;HtmlMeta metaTagAuthor = new HtmlMeta(); &lt;br /&gt;&amp;nbsp;&amp;nbsp;HtmlMeta metaTagKeywords = new HtmlMeta(); &lt;br /&gt;&amp;nbsp;&amp;nbsp;HtmlMeta metaTagDescription = new HtmlMeta(); &lt;br /&gt;&amp;nbsp;&amp;nbsp;metaTagAuthor.Name = "Author"; &lt;br /&gt;&amp;nbsp;&amp;nbsp;metaTagAuthor.Content = "Your Name"; //Add your name here &lt;br /&gt;&amp;nbsp;&amp;nbsp;metaTagKeywords.Name = "Keywords"; &lt;br /&gt;&amp;nbsp;&amp;nbsp;metaTagKeywords.Content = ""; //Add all your keywords here &lt;br /&gt;&amp;nbsp;&amp;nbsp;metaTagDescription.Name = "Description"; &lt;br /&gt;&amp;nbsp;&amp;nbsp;metaTagDescription.Content = "";//Add you webpage's description here &lt;br /&gt;&amp;nbsp;&amp;nbsp;this.Page.Header.Controls.Add(metaTagKeywords);&lt;br /&gt;&amp;nbsp;&amp;nbsp;this.Page.Header.Controls.Add(metaTagDescription); &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Hope you find this article useful. I have implemented the same for one of our websites &lt;a href="http://www.ezsmartads.com/"&gt;&lt;strong&gt;www.ezsmartads.com&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Thanks!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-3765692305375675419?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/U_ZXvvxR8pjhQA5prE7ZJxiEeCw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/U_ZXvvxR8pjhQA5prE7ZJxiEeCw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/U_ZXvvxR8pjhQA5prE7ZJxiEeCw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/U_ZXvvxR8pjhQA5prE7ZJxiEeCw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/3iX15jR-IsQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/3765692305375675419/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2008/08/aspnet-master-pages-and-search-engine.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/3765692305375675419?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/3765692305375675419?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/3iX15jR-IsQ/aspnet-master-pages-and-search-engine.html" title="ASP.NET - Master pages and Search Engine Optimization:" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2008/08/aspnet-master-pages-and-search-engine.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UMQXs-eCp7ImA9WBFQF0g.&quot;"><id>tag:blogger.com,1999:blog-428623601829508772.post-3411376774004781929</id><published>2007-03-12T20:04:00.000-07:00</published><updated>2007-03-12T20:08:00.550-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-03-12T20:08:00.550-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ADO.NET 2.0" /><title>Provider Independent Dataaccess using ADO.NET 2.0</title><content type="html">Found this interesting article on provider independent dataaccess using ADO.NET 2.0&lt;br /&gt;&lt;br /&gt;&lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=132226"&gt;http://channel9.msdn.com/Showpost.aspx?postid=132226&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/428623601829508772-3411376774004781929?l=arahuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5LOrvigFkgiFR889jdeYtqxkOKE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5LOrvigFkgiFR889jdeYtqxkOKE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5LOrvigFkgiFR889jdeYtqxkOKE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5LOrvigFkgiFR889jdeYtqxkOKE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbdulRahumansBlog/~4/TwLUo2PhOys" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://arahuman.blogspot.com/feeds/3411376774004781929/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://arahuman.blogspot.com/2007/03/provider-independent-dataaccess-using.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/3411376774004781929?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/428623601829508772/posts/default/3411376774004781929?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/AbdulRahumansBlog/~3/TwLUo2PhOys/provider-independent-dataaccess-using.html" title="Provider Independent Dataaccess using ADO.NET 2.0" /><author><name>Rahuman</name><uri>http://www.blogger.com/profile/01222479360415180681</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://arahuman.blogspot.com/2007/03/provider-independent-dataaccess-using.html</feedburner:origLink></entry></feed>

