<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Amit Kumar</title>
	<atom:link href="http://amitkumardotnet.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://amitkumardotnet.wordpress.com</link>
	<description>This is the right place to discuss about WPF, WCF, Windows Service and XAML.Come and join with me to share more idea about this amazing technology.</description>
	<lastBuildDate>Tue, 18 Aug 2009 08:53:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='amitkumardotnet.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/972e264cd447041b4ad1bf9938fd8a6b?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Amit Kumar</title>
		<link>http://amitkumardotnet.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://amitkumardotnet.wordpress.com/osd.xml" title="Amit Kumar" />
	<atom:link rel='hub' href='http://amitkumardotnet.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How can we get the  MAC Address in C# Application.</title>
		<link>http://amitkumardotnet.wordpress.com/2009/08/18/how-can-we-get-the-mac-address-in-c-application/</link>
		<comments>http://amitkumardotnet.wordpress.com/2009/08/18/how-can-we-get-the-mac-address-in-c-application/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 08:45:15 +0000</pubDate>
		<dc:creator>amitkumardotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[MAC Address]]></category>
		<category><![CDATA[System.Management namespace]]></category>
		<category><![CDATA[WMI Class in .Net]]></category>

		<guid isPermaLink="false">http://amitkumardotnet.wordpress.com/?p=49</guid>
		<description><![CDATA[To fetch or get the MAC Address in C# application we have to use  &#8220;Win32_NetworkAdapterConfiguration&#8221;  WMI class. This class represent the attributes and behavior of the network adapter card. This class includes extra properties and methods that support the management of the TCP/IP and Internetwork Packet Exchange (IPX) protocols that are independent from the network [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitkumardotnet.wordpress.com&amp;blog=6445569&amp;post=49&amp;subd=amitkumardotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To fetch or get the MAC Address in C# application we have to use  &#8220;Win32_NetworkAdapterConfiguration&#8221;  WMI class. This class represent the attributes and behavior of the network adapter card. This class includes extra properties and methods that support the management of the TCP/IP and Internetwork Packet Exchange (IPX) protocols that are independent from the network adapter. These are the list of the Properties of the “Win32_NetworkAdapterConfiguration” class.</p>
<p> boolean ArpAlwaysSourceRoute;</p>
<p> boolean ArpUseEtherSNAP;</p>
<p>string Caption;</p>
<p>string DatabasePath;</p>
<p> boolean DeadGWDetectEnabled;</p>
<p>string DefaultIPGateway[];</p>
<p>uint8 DefaultTOS;</p>
<p>uint8 DefaultTTL;</p>
<p>string Description;</p>
<p> boolean DHCPEnabled;</p>
<p>datetime DHCPLeaseExpires;</p>
<p> datetime DHCPLeaseObtained;</p>
<p> string DHCPServer;</p>
<p>string DNSDomain;</p>
<p>string DNSDomainSuffixSearchOrder[];</p>
<p> boolean DNSEnabledForWINSResolution;</p>
<p> string DNSHostName;</p>
<p>string DNSServerSearchOrder[];</p>
<p> boolean DomainDNSRegistrationEnabled;</p>
<p> uint32 ForwardBufferMemory;</p>
<p> boolean FullDNSRegistrationEnabled;</p>
<p>uint16 GatewayCostMetric[];</p>
<p> uint8 IGMPLevel;</p>
<p> uint32 Index;</p>
<p> uint32 InterfaceIndex;</p>
<p>string IPAddress[];</p>
<p> uint32 IPConnectionMetric;</p>
<p>boolean IPEnabled;</p>
<p>boolean IPFilterSecurityEnabled;</p>
<p> boolean IPPortSecurityEnabled;</p>
<p>string IPSecPermitIPProtocols[];</p>
<p> string IPSecPermitTCPPorts[];</p>
<p> string IPSecPermitUDPPorts[];</p>
<p> string IPSubnet[];</p>
<p> boolean IPUseZeroBroadcast;</p>
<p> string IPXAddress;</p>
<p>boolean IPXEnabled;</p>
<p>uint32 IPXFrameType[];</p>
<p> uint32 IPXMediaType;</p>
<p> string IPXNetworkNumber[];</p>
<p>string IPXVirtualNetNumber;</p>
<p>uint32 KeepAliveInterval;</p>
<p> uint32 KeepAliveTime;</p>
<p> string MACAddress;</p>
<p>uint32 MTU;</p>
<p> uint32 NumForwardPackets;</p>
<p> boolean PMTUBHDetectEnabled;</p>
<p> boolean PMTUDiscoveryEnabled;</p>
<p> string ServiceName;</p>
<p> string SettingID;</p>
<p> uint32 TcpipNetbiosOptions;</p>
<p> uint32 TcpMaxConnectRetransmissions;</p>
<p> uint32 TcpMaxDataRetransmissions;</p>
<p> uint32 TcpNumConnections;</p>
<p>boolean TcpUseRFC1122UrgentPointer;</p>
<p> uint16 TcpWindowSize;</p>
<p>boolean WINSEnableLMHostsLookup;</p>
<p>string WINSHostLookupFile;</p>
<p>string WINSPrimaryServer;</p>
<p>string WINSScopeID;</p>
<p>string WINSSecondaryServer;</p>
<p> Note:- The “Win32_NetworkAdapterConfiguration” class is present under the System.Management Namespace. So before using the “Win32_NetworkAdapterConfiguration” class you must add the refrence of System.Management namespace in your project.</p>
<p>Here is the  a function written in c#, that return the MAC address of the system</p>
<p>private string GetMacAddress()</p>
<p>        {</p>
<p>            string macid = string.Empty;</p>
<p>            ManagementClass mac = new ManagementClass(&#8220;Win32_NetworkAdapterConfiguration&#8221;);</p>
<p>            ManagementObjectCollection macObjCol = mac.GetInstances();</p>
<p>            foreach (ManagementObject mo in macObjCol)</p>
<p>            {</p>
<p>                if (macid.Equals(string.Empty))</p>
<p>                {</p>
<p>                    if ((bool)mo["IPEnabled"] == true)</p>
<p>                    {</p>
<p>                        macid = mo["MacAddress"].ToString();</p>
<p>                        mo.Dispose();</p>
<p>                    }</p>
<p>                }</p>
<p>            }</p>
<p>            return macid;</p>
<p>        }</p>
<p>Used Namespace</p>
<p>System.Management;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitkumardotnet.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitkumardotnet.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitkumardotnet.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitkumardotnet.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/amitkumardotnet.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/amitkumardotnet.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/amitkumardotnet.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/amitkumardotnet.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitkumardotnet.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitkumardotnet.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitkumardotnet.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitkumardotnet.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitkumardotnet.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitkumardotnet.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitkumardotnet.wordpress.com&amp;blog=6445569&amp;post=49&amp;subd=amitkumardotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amitkumardotnet.wordpress.com/2009/08/18/how-can-we-get-the-mac-address-in-c-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c13139cce4b675fcfacba6ed4beb72bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amitkumardotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom Paging in DataList in ASP.Net</title>
		<link>http://amitkumardotnet.wordpress.com/2009/06/26/custom-paging-in-datalist-in-asp-net/</link>
		<comments>http://amitkumardotnet.wordpress.com/2009/06/26/custom-paging-in-datalist-in-asp-net/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 09:46:19 +0000</pubDate>
		<dc:creator>amitkumardotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://amitkumardotnet.wordpress.com/?p=42</guid>
		<description><![CDATA[This article we describe DataList Paging with Next, previous and First, Last page access functionality. A numbers list is also displayed for accessing pages faster.     Background Few days back when I required to implement custom paging in DataList(like a google paging). I search out the Internet but did not find any perfect code. Then [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitkumardotnet.wordpress.com&amp;blog=6445569&amp;post=42&amp;subd=amitkumardotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This article we describe DataList Paging with Next, previous and First, Last page access functionality. A numbers list is also displayed for accessing pages faster.</p>
<p> </p>
<p> </p>
<p><strong>Background</strong><strong></strong></p>
<p>Few days back when I required to implement custom paging in DataList(like a google paging). I search out the Internet but did not find any perfect code. Then after some effort I wrote my own code. I decided to share it with other users. Surely this will help other developers.</p>
<p>For  creating the custom paging in the DataList control we need two  DataList control, one for displaying the Data from the Database to the DataList and other for handling the  Custom Paging.</p>
<p>After it we create three properties</p>
<ol>
<li>CurrentPage</li>
<li>FirstPage</li>
<li>NextPage</li>
</ol>
<p>The definition of the CurrentPage Property is</p>
<p>private int CurrentPage</p>
<p>    {</p>
<p>        get</p>
<p>        {</p>
<p>            object objPage = ViewState["_CurrentPage"];</p>
<p>            int _CurrentPage = 0;</p>
<p>            if (objPage == null)</p>
<p>            {</p>
<p>                _CurrentPage = 0;</p>
<p>            }</p>
<p>            else</p>
<p>            {</p>
<p>                _CurrentPage = (int)objPage;</p>
<p>            }</p>
<p>            return _CurrentPage;</p>
<p>        }</p>
<p>        set</p>
<p>        {</p>
<p>            ViewState["_CurrentPage"] = value;</p>
<p> </p>
<p>        }</p>
<p>    }</p>
<p> </p>
<p> </p>
<p>The definition for the FirstPage property is</p>
<p>private int FirstPage</p>
<p>    {</p>
<p>        get</p>
<p>        {</p>
<p>           int _FirstIndex = 0;</p>
<p>            if (ViewState["_FirstIndex"] == null)</p>
<p>            {</p>
<p>                _FirstIndex = 0;</p>
<p>            }</p>
<p>            else</p>
<p>            {</p>
<p>                _FirstIndex = Convert.ToInt32(ViewState["_FirstIndex"]);</p>
<p>            }</p>
<p>            return _FirstIndex;</p>
<p>        }</p>
<p>        set</p>
<p>        {</p>
<p>            ViewState["_FirstIndex"] = value;</p>
<p>        }</p>
<p>    }</p>
<p>The definition  for the LastPage property is</p>
<p>private int LastPage</p>
<p>    {</p>
<p>        get</p>
<p>        {</p>
<p>            int _LastIndex = 0;</p>
<p>            if (ViewState["_LastIndex"] == null)</p>
<p>            {</p>
<p>                _LastIndex = 0;</p>
<p> </p>
<p>            }</p>
<p>            else</p>
<p>            {</p>
<p>                _LastIndex = Convert.ToInt32(ViewState["_LastIndex"]);</p>
<p>            }</p>
<p>            return _LastIndex;</p>
<p>        }</p>
<p>        set</p>
<p>        {</p>
<p>            ViewState["_LastIndex"] = value;</p>
<p>        }</p>
<p>    }</p>
<p>Note:- We need two Member function</p>
<p>Declare it before writing the function, just below the Partial class</p>
<p>PagedDataSource _pageData = new PagedDataSource();</p>
<ol>
<li>BindBlogDataList()</li>
<li>handlePaging()</li>
</ol>
<p> </p>
<p>Definition for BindBlogDataList()</p>
<p>private void BindBlogDataList()</p>
<p>    {</p>
<p>        DataTable dt = _objBlog.BlogContent.GetBlogDetails();</p>
<p> //dataListBlogDetails.DataSource = _objBlog.BlogContent.GetBlogDetails();</p>
<p>        //dataListBlogDetails.DataBind();</p>
<p> </p>
<p>        _pageData.DataSource = dt.DefaultView;</p>
<p>        _pageData.AllowPaging = true;</p>
<p>        _pageData.PageSize = 10;</p>
<p>        _pageData.CurrentPageIndex = CurrentPage;</p>
<p>        ViewState["TotalPages"] = _pageData.PageCount;</p>
<p> </p>
<p>        this.lblPageInfo.Text = &#8220;Page &#8221; + (CurrentPage + 1) + &#8221; of &#8221; +         _pageData.PageCount;</p>
<p>        this.lbtnPrevious.Enabled = !_pageData.IsFirstPage;</p>
<p>        this.lbtnNext.Enabled = !_pageData.IsLastPage;</p>
<p>        this.lbtnFirst.Enabled = !_pageData.IsFirstPage;</p>
<p>        this.lbtnLast.Enabled = !_pageData.IsLastPage;</p>
<p> </p>
<p>        ddlBlogDetails.DataSource = _pageData;</p>
<p>        ddlBlogDetails.DataBind();</p>
<p>        this. handlePaging();</p>
<p> </p>
<p>    }</p>
<p>Definition for handlePaging()</p>
<p>private void handlePaging ()</p>
<p>    {</p>
<p>        DataTable dt = new DataTable();</p>
<p>        dt.Columns.Add(&#8220;PageIndex&#8221;);</p>
<p>        dt.Columns.Add(&#8220;PageText&#8221;);</p>
<p>        FirstPage = CurrentPage &#8211; 5;</p>
<p>        if (CurrentPage &gt; 5)</p>
<p>        {</p>
<p>            LastPage = CurrentPage + 5;</p>
<p>        }</p>
<p>        else</p>
<p>        {</p>
<p>            LastPage = 10;</p>
<p>        }</p>
<p>        if (LastPage &gt; Convert.ToInt32(ViewState["TotalPages"]))</p>
<p>        {</p>
<p>            LastPage = Convert.ToInt32(ViewState["TotalPages"]);</p>
<p>            FirstPage = LastPage &#8211; 10;</p>
<p>        }</p>
<p>        if (FirstPage &lt; 0)</p>
<p>        {</p>
<p>            FirstPage = 0;</p>
<p>        }</p>
<p>        for (int i = FirstPage; i &lt; LastPage; i++)</p>
<p>        {</p>
<p>            DataRow dr = dt.NewRow();</p>
<p>            dr[0] = i;</p>
<p>            dr[1] = i + 1;</p>
<p>            dt.Rows.Add(dr);</p>
<p>        }</p>
<p>        this. ddlPaging.DataSource = dt;</p>
<p>        this. ddlPaging.DataBind();</p>
<p>    }</p>
<p> </p>
<p>Details of Default.aspx page</p>
<p>&lt;table width=&#8221;100%&#8221;&gt;</p>
<p>            &lt;tr&gt;</p>
<p>                &lt;td align=&#8221;center&#8221;&gt;</p>
<p>                    &lt;strong&gt;View Blogs&lt;/strong&gt;&lt;/td&gt;</p>
<p>            &lt;/tr&gt;</p>
<p>            &lt;tr&gt;</p>
<p>                &lt;td align=&#8221;left&#8221;&gt;</p>
<p>                    &lt;asp:DataList runat=&#8221;server&#8221; ID=&#8221;ddlBlogDetails &#8221; CellPadding=&#8221;2&#8243;&gt;</p>
<p>                        &lt;ItemTemplate&gt;</p>
<p>                          &lt;asp:Label ID=&#8221;lblBlogId&#8221; runat=&#8221;server&#8221; Text=&#8217;&lt;%#Eval(&#8220;BlogContentId&#8221;)%&gt;&#8217;  Visible=&#8221;false&#8221;&gt;&lt;/asp:Label&gt;</p>
<p>                          BlogTitle:-</p>
<p>                        &lt;asp:Label ID=&#8221;Label1&#8243; runat=&#8221;server&#8221; Text=&#8217;&lt;%#Eval(&#8220;BlogTitle&#8221;) %&gt;&#8217;&gt;&lt;/asp:Label&gt;</p>
<p>                        &lt;br /&gt;</p>
<p>                        Created On:-</p>
<p>                            &lt;asp:Label ID=&#8221;lblDate&#8221; runat=&#8221;server&#8221; ReadOnly=&#8221;true&#8221; Text=&#8217;&lt;%#Eval(&#8220;CreatedOn&#8221;) %&gt;&#8217; &gt;&lt;/asp:Label&gt;</p>
<p>                            &lt;br /&gt;</p>
<p>                        Left by:-</p>
<p>                        &lt;asp:Label ID=&#8221;lblLeftBy&#8221; runat=&#8221;server&#8221; Text=&#8217;&lt;%#Eval(&#8220;LeftByName&#8221;) %&gt;&#8217;&gt;&lt;/asp:Label&gt;</p>
<p>                        &lt;br /&gt;</p>
<p>                        Description:-</p>
<p>                        &lt;asp:Label ID=&#8221;lblDetails&#8221; runat=&#8221;server&#8221; Text=&#8217;&lt;%# myfunction(Eval(&#8220;BlogDescription&#8221;)) %&gt;&#8217;&gt;&lt;/asp:Label&gt;</p>
<p>                                                 </p>
<p>                        &lt;/ItemTemplate&gt;</p>
<p>                        &lt;SeparatorTemplate&gt;</p>
<p>                        &lt;hr /&gt;</p>
<p>                        &lt;/SeparatorTemplate&gt;</p>
<p>                        &lt;AlternatingItemStyle BackColor=&#8221;Silver&#8221; /&gt;</p>
<p>                        &lt;ItemStyle BackColor=&#8221;White&#8221; /&gt;</p>
<p>                    &lt;/asp:DataList&gt;</p>
<p>                &lt;/td&gt;</p>
<p>            &lt;/tr&gt;</p>
<p>            &lt;tr&gt;</p>
<p>                &lt;td&gt;</p>
<p>                 &lt;%&#8211;&lt;asp:LinkButton runat=&#8221;server&#8221; Text=&#8221;Create New Blog&#8221;</p>
<p>                        onclick=&#8221;lnkBtnCreateNewBlog_Click&#8221;&gt;&lt;/asp:LinkButton&gt;&#8211;%&gt;  </p>
<p>                 &lt;/td&gt;</p>
<p>            &lt;/tr&gt;</p>
<p>            &lt;tr&gt;</p>
<p>                &lt;td&gt;</p>
<p>                    &lt;table cellpadding=&#8221;0&#8243; border=&#8221;0&#8243;&gt;</p>
<p>                        &lt;tr&gt;</p>
<p>                            &lt;td align=&#8221;right&#8221;&gt;</p>
<p>                                &lt;asp:LinkButton ID=&#8221;lbtnFirst&#8221; runat=&#8221;server&#8221; CausesValidation=&#8221;false&#8221;</p>
<p>                                    onclick=&#8221;lbtnFirst_Click&#8221;&gt;First&lt;/asp:LinkButton&gt;</p>
<p>                                &amp;nbsp;&lt;/td&gt;</p>
<p>                            &lt;td align=&#8221;right&#8221;&gt;</p>
<p>                                &lt;asp:LinkButton ID=&#8221;lbtnPrevious&#8221; runat=&#8221;server&#8221; CausesValidation=&#8221;false&#8221;</p>
<p>                                    onclick=&#8221;lbtnPrevious_Click&#8221;&gt;Previous&lt;/asp:LinkButton&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;</p>
<p>                            &lt;td align=&#8221;center&#8221; valign=&#8221;middle&#8221;&gt;</p>
<p>                                &lt;asp:DataList ID=&#8221;ddlPaging&#8221; runat=&#8221;server&#8221; RepeatDirection=&#8221;Horizontal&#8221;</p>
<p>                                    OnItemCommand=&#8221;ddlPaging_ItemCommand&#8221; onitemdatabound=&#8221;ddlPaging_ItemDataBound&#8221;</p>
<p>                                   &gt;</p>
<p>                                    &lt;ItemTemplate&gt;</p>
<p>                                        &lt;asp:LinkButton ID=&#8221;lnkbtnPaging&#8221; runat=&#8221;server&#8221; CommandArgument=&#8217;&lt;%# Eval(&#8220;PageIndex&#8221;) %&gt;&#8217;</p>
<p>                                            CommandName=&#8221;Paging&#8221; Text=&#8217;&lt;%# Eval(&#8220;PageText&#8221;) %&gt;&#8217;&gt;&lt;/asp:LinkButton&gt;&amp;nbsp;</p>
<p>                                    &lt;/ItemTemplate&gt;</p>
<p>                                &lt;/asp:DataList&gt;</p>
<p>                            &lt;/td&gt;</p>
<p>                            &lt;td align=&#8221;left&#8221;&gt;</p>
<p>                                &amp;nbsp;&amp;nbsp;&lt;asp:LinkButton ID=&#8221;lbtnNext&#8221; runat=&#8221;server&#8221;</p>
<p>                                    CausesValidation=&#8221;false&#8221; onclick=&#8221;lbtnNext_Click&#8221;&gt;Next&lt;/asp:LinkButton&gt;&lt;/td&gt;</p>
<p>                            &lt;td align=&#8221;left&#8221;&gt;</p>
<p>                                &amp;nbsp;</p>
<p>                                &lt;asp:LinkButton ID=&#8221;lbtnLast&#8221; runat=&#8221;server&#8221; CausesValidation=&#8221;false&#8221;</p>
<p>                                    onclick=&#8221;lbtnLast_Click&#8221;&gt;Last&lt;/asp:LinkButton&gt;&lt;/td&gt;</p>
<p>                        &lt;/tr&gt;</p>
<p>                        &lt;tr&gt;</p>
<p>                            &lt;td colspan=&#8221;5&#8243; align=&#8221;center&#8221; style=&#8221;height: 30px&#8221; valign=&#8221;middle&#8221;&gt;</p>
<p>                                &lt;asp:Label ID=&#8221;lblPageInfo&#8221; runat=&#8221;server&#8221;&gt;&lt;/asp:Label&gt;</p>
<p>                                &lt;/td&gt;</p>
<p>                        &lt;/tr&gt;</p>
<p>                    &lt;/table&gt;</p>
<p>                &lt;/td&gt;</p>
<p>            &lt;/tr&gt;</p>
<p>        &lt;/table&gt;</p>
<p> </p>
<p>Details of Default.aspx.cs file</p>
<p>protected void ddlPaging_ItemCommand(object source, DataListCommandEventArgs e)</p>
<p>    {</p>
<p>        if (e.CommandName.Equals(&#8220;Paging&#8221;))</p>
<p>        {</p>
<p>            CurrentPage = Convert.ToInt16(e.CommandArgument.ToString());</p>
<p>            this.BindBlogDataList();</p>
<p>        }</p>
<p>    }</p>
<p> </p>
<p> </p>
<p>protected void ddlPaging_ItemDataBound(object sender, DataListItemEventArgs e)</p>
<p>    {</p>
<p>        LinkButton lnkbtnPage = (LinkButton)e.Item.FindControl(&#8220;lnkbtnPaging&#8221;);</p>
<p>        if (lnkbtnPage.CommandArgument.ToString() == CurrentPage.ToString())</p>
<p>        {</p>
<p>            lnkbtnPage.Enabled = false;</p>
<p>            lnkbtnPage.Style.Add(&#8220;fone-size&#8221;, &#8220;14px&#8221;);</p>
<p>            lnkbtnPage.Font.Bold = true;</p>
<p> </p>
<p>        }</p>
<p>    }</p>
<p> </p>
<p>//Page Load</p>
<p>protected void Page_Load(object sender, EventArgs e)</p>
<p>    {</p>
<p>        if (!Page.IsPostBack)</p>
<p>        {</p>
<p>            BindBlogDataList();</p>
<p>        }</p>
<p>       </p>
<p>    }</p>
<p>//First Link Button Click</p>
<p>protected void lbtnFirst_Click(object sender, EventArgs e)</p>
<p>    {</p>
<p>        CurrentPage = 0;</p>
<p>        BindBlogDataList();</p>
<p>    }</p>
<p>//Previous Link Button Click</p>
<p>protected void lbtnPrevious_Click(object sender, EventArgs e)</p>
<p>    {</p>
<p>        CurrentPage -= 1;</p>
<p>        BindBlogDataList();</p>
<p> </p>
<p> </p>
<p>    }</p>
<p>//Next Link Button Click</p>
<p>protected void lbtnNext_Click(object sender, EventArgs e)</p>
<p>    {</p>
<p>        CurrentPage += 1;</p>
<p>        BindBlogDataList();</p>
<p>    }</p>
<p>//Last Link Button Click</p>
<p>protected void lbtnLast_Click(object sender, EventArgs e)</p>
<p>    {</p>
<p>        CurrentPage = (Convert.ToInt32(ViewState["TotalPages"]) &#8211; 1);</p>
<p>        BindBlogDataList();</p>
<p> </p>
<p>    }</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> Custom Paging In DataList</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitkumardotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitkumardotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitkumardotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitkumardotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/amitkumardotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/amitkumardotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/amitkumardotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/amitkumardotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitkumardotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitkumardotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitkumardotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitkumardotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitkumardotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitkumardotnet.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitkumardotnet.wordpress.com&amp;blog=6445569&amp;post=42&amp;subd=amitkumardotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amitkumardotnet.wordpress.com/2009/06/26/custom-paging-in-datalist-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c13139cce4b675fcfacba6ed4beb72bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amitkumardotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Difference Between DataSet and RecordSet</title>
		<link>http://amitkumardotnet.wordpress.com/2009/06/19/difference-between-dataset-and-recordset/</link>
		<comments>http://amitkumardotnet.wordpress.com/2009/06/19/difference-between-dataset-and-recordset/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 13:41:07 +0000</pubDate>
		<dc:creator>amitkumardotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://amitkumardotnet.wordpress.com/?p=39</guid>
		<description><![CDATA[1.Recordset provides data one row at a time. Dataset is a data structure which represents the complete table data at same time. 2.Recordset has the logic to update and manipulate data. Dataset is just a data store and manipulation is done through DataAdapters in .NET. 3.Dataset Disconnected architecture. Record Set Connected Architecture. 4.With Data set [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitkumardotnet.wordpress.com&amp;blog=6445569&amp;post=39&amp;subd=amitkumardotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1.Recordset provides data one row at a time.<br />
Dataset is a data structure which represents the complete table data at same time.</p>
<p>2.Recordset has the logic to update and manipulate data.<br />
Dataset is just a data store and manipulation is done through DataAdapters in .NET.</p>
<p>3.Dataset Disconnected architecture.<br />
Record Set Connected Architecture.</p>
<p>4.With Data set you can retrive data from database like oracle and SQL Server and manage them in one dataset, with recordset this is not possible.</p>
<p>5. All representation of Dataset is using XML while recordset uses COM.</p>
<p>6. The Recordset was not XML-based and could not be serialized to XML easily or flexibly.</p>
<p>7. Recordset can not be transmitted on HTTP while Dataset can be.</p>
<p>8. A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.</p>
<p>9. A DataSet is designed to work without any continuing connection to the original data source.</p>
<p>10. Data in a DataSet is bulk-loaded, rather than being loaded on demand.</p>
<p>11. There&#8217;s no concept of cursor types in a DataSet.</p>
<p>12. DataSets have no current record pointer You can use For Each loops to move through the data.</p>
<p>13. You can store many edits in a DataSet, and write them to the original data source in a single operation.</p>
<p>14. Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitkumardotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitkumardotnet.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitkumardotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitkumardotnet.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/amitkumardotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/amitkumardotnet.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/amitkumardotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/amitkumardotnet.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitkumardotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitkumardotnet.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitkumardotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitkumardotnet.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitkumardotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitkumardotnet.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitkumardotnet.wordpress.com&amp;blog=6445569&amp;post=39&amp;subd=amitkumardotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amitkumardotnet.wordpress.com/2009/06/19/difference-between-dataset-and-recordset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c13139cce4b675fcfacba6ed4beb72bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amitkumardotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert DataSet To RecordSet</title>
		<link>http://amitkumardotnet.wordpress.com/2009/06/19/convert-dataset-to-recordset/</link>
		<comments>http://amitkumardotnet.wordpress.com/2009/06/19/convert-dataset-to-recordset/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 13:15:54 +0000</pubDate>
		<dc:creator>amitkumardotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://amitkumardotnet.wordpress.com/?p=36</guid>
		<description><![CDATA[Hi, Friends I am going to express a new topic which is more intresting , the topic is how we convert a ADO.Net DataSet  to ADO RecordSet. I need this conversion, when we are working BI-Reporting Application. In this project we have a third party control, its name is TeeChart6.0. control. That control takes a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitkumardotnet.wordpress.com&amp;blog=6445569&amp;post=36&amp;subd=amitkumardotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi, Friends</p>
<p>I am going to express a new topic which is more intresting , the topic is how we convert a ADO.Net DataSet  to ADO RecordSet.</p>
<p>I need this conversion, when we are working BI-Reporting Application. In this project we have a third party control, its name is TeeChart6.0. control. That control takes a record set not the Dataset. When we try to pass the DataSet to TeeChart control it fires a COM Exception so, I need this conversion.</p>
<p> </p>
<p>Before doing the conversion from DataSet to RecordSet , you must take the refrence of the ADOB library version 7.0.3300.0.</p>
<p> </p>
<p>Now we post the complete code of it.</p>
<p>For doing this we create three function</p>
<p>1. bool CheckIntDataTpye(Type colType) : It check for the DataType</p>
<p>2.  static ADODB.Recordset ConvertDsToRs(DataTable inTable):- It convert the DS to RS.</p>
<p>3. static ADODB.DataTypeEnum TranslateColumnType(Type columnType):- It is for DataTypeEnum.</p>
<p>Function Body</p>
<p>1.</p>
<p>  private bool CheckIntDataTpye(Type colType)</p>
<p>        {</p>
<p>            switch (colType.UnderlyingSystemType.ToString())</p>
<p>            {</p>
<p>                case &#8220;System.Int16&#8243;:</p>
<p>                    return true;</p>
<p>               case &#8220;System.Int32&#8243;:</p>
<p>                    return true;</p>
<p>               case &#8220;System.Int64&#8243;:</p>
<p>                    return true;</p>
<p>                case &#8220;System.SByte&#8221;:</p>
<p>                    return true;</p>
<p>                case &#8220;System.Byte&#8221;:</p>
<p>                    return true;</p>
<p>                case &#8220;System.Decimal&#8221;:</p>
<p>                    return true;</p>
<p>                case &#8220;System.Double&#8221;:</p>
<p>                    return true;</p>
<p>                case &#8220;System.Single&#8221;:</p>
<p>                    return true;</p>
<p>                case &#8220;System.UInt16&#8243;:</p>
<p>                    return true;</p>
<p>                case &#8220;System.UInt32&#8243;:</p>
<p>                    return true;</p>
<p>                case &#8220;System.UInt64&#8243;:</p>
<p>                    return true;</p>
<p>                default:</p>
<p>                    return false;</p>
<p>            }</p>
<p>        }</p>
<p> </p>
<p>Function Body</p>
<p>2.</p>
<p>  public static ADODB.Recordset ConvertDsToRs(DataTable inTable)</p>
<p>        {</p>
<p>            ADODB.Recordset result = new ADODB.Recordset();</p>
<p>            result.CursorLocation = ADODB.CursorLocationEnum.adUseClient;</p>
<p>            ADODB.Fields resultField = result.Fields;</p>
<p>            System.Data.DataColumnCollection inColumns = inTable.Columns;</p>
<p>            foreach (DataColumn inColumn in inColumns)</p>
<p>            {</p>
<p>                resultField.Append(inColumn.ColumnName, TranslateColumnType(inColumn.DataType), inColumn.MaxLength, inColumn.AllowDBNull ? ADODB.FieldAttributeEnum.adFldIsNullable : ADODB.FieldAttributeEnum.adFldUnspecified, null);</p>
<p> </p>
<p>            }</p>
<p>            result.Open(System.Reflection.Missing.Value, System.Reflection.Missing.Value, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic, 0);</p>
<p>            foreach (DataRow dr in inTable.Rows)</p>
<p>            {</p>
<p>                result.AddNew(System.Reflection.Missing.Value, System.Reflection.Missing.Value);</p>
<p>                for (int colIndex = 0; colIndex &lt; inColumns.Count; colIndex++)</p>
<p>                {</p>
<p>                    resultField[colIndex].Value = dr[colIndex];</p>
<p>                }</p>
<p>            }</p>
<p> </p>
<p> </p>
<p> </p>
<p>            return result;</p>
<p>        }</p>
<p>Function Body</p>
<p>3.</p>
<p>   private static ADODB.DataTypeEnum TranslateColumnType(Type columnType)</p>
<p>        {</p>
<p>            switch (columnType.UnderlyingSystemType.ToString())</p>
<p>            {</p>
<p>                case &#8220;System.Boolean&#8221;:</p>
<p>                    return ADODB.DataTypeEnum.adBoolean;</p>
<p> </p>
<p>                case &#8220;System.Byte&#8221;:</p>
<p>                    return ADODB.DataTypeEnum.adUnsignedTinyInt;</p>
<p> </p>
<p>                case &#8220;System.Char&#8221;:</p>
<p>                    return ADODB.DataTypeEnum.adChar;</p>
<p> </p>
<p>                case &#8220;System.DateTime&#8221;:</p>
<p>                    return ADODB.DataTypeEnum.adDate;</p>
<p> </p>
<p>                case &#8220;System.Decimal&#8221;:</p>
<p>                    return ADODB.DataTypeEnum.adCurrency;</p>
<p> </p>
<p>                case &#8220;System.Double&#8221;:</p>
<p>                    return ADODB.DataTypeEnum.adDouble;</p>
<p> </p>
<p>                case &#8220;System.Int16&#8243;:</p>
<p>                    return ADODB.DataTypeEnum.adSmallInt;</p>
<p> </p>
<p>                case &#8220;System.Int32&#8243;:</p>
<p>                    return ADODB.DataTypeEnum.adInteger;</p>
<p> </p>
<p>                case &#8220;System.Int64&#8243;:</p>
<p>                    return ADODB.DataTypeEnum.adBigInt;</p>
<p> </p>
<p>                case &#8220;System.SByte&#8221;:</p>
<p>                    return ADODB.DataTypeEnum.adTinyInt;</p>
<p> </p>
<p>                case &#8220;System.Single&#8221;:</p>
<p>                    return ADODB.DataTypeEnum.adSingle;</p>
<p> </p>
<p>                case &#8220;System.UInt16&#8243;:</p>
<p>                    return ADODB.DataTypeEnum.adUnsignedSmallInt;</p>
<p> </p>
<p>                case &#8220;System.UInt32&#8243;:</p>
<p>                    return ADODB.DataTypeEnum.adUnsignedInt;</p>
<p> </p>
<p>                case &#8220;System.UInt64&#8243;:</p>
<p>                    return ADODB.DataTypeEnum.adUnsignedBigInt;</p>
<p> </p>
<p>                case &#8220;System.String&#8221;:</p>
<p>                default:</p>
<p>                    return ADODB.DataTypeEnum.adVarChar;</p>
<p>            }</p>
<p> </p>
<p>        }</p>
<p> </p>
<p>Note:- Used Namespaces</p>
<p>using System.Data.SqlClient;</p>
<p>using System.Data;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitkumardotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitkumardotnet.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitkumardotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitkumardotnet.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/amitkumardotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/amitkumardotnet.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/amitkumardotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/amitkumardotnet.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitkumardotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitkumardotnet.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitkumardotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitkumardotnet.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitkumardotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitkumardotnet.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitkumardotnet.wordpress.com&amp;blog=6445569&amp;post=36&amp;subd=amitkumardotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amitkumardotnet.wordpress.com/2009/06/19/convert-dataset-to-recordset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c13139cce4b675fcfacba6ed4beb72bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amitkumardotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Resource Dictionary in WPF</title>
		<link>http://amitkumardotnet.wordpress.com/2009/02/04/resource-dictionary-in-wpf/</link>
		<comments>http://amitkumardotnet.wordpress.com/2009/02/04/resource-dictionary-in-wpf/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 09:49:42 +0000</pubDate>
		<dc:creator>amitkumardotnet</dc:creator>
				<category><![CDATA[WPF]]></category>
		<category><![CDATA[Resouce Dictionary]]></category>
		<category><![CDATA[Stye]]></category>

		<guid isPermaLink="false">http://amitkumardotnet.wordpress.com/2009/02/04/resource-dictionary-in-wpf/</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitkumardotnet.wordpress.com&amp;blog=6445569&amp;post=17&amp;subd=amitkumardotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitkumardotnet.wordpress.com&amp;blog=6445569&amp;post=17&amp;subd=amitkumardotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amitkumardotnet.wordpress.com/2009/02/04/resource-dictionary-in-wpf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c13139cce4b675fcfacba6ed4beb72bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amitkumardotnet</media:title>
		</media:content>
	</item>
	</channel>
</rss>
