<?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>Techie's Blog</title>
	<atom:link href="http://iamtechie.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://iamtechie.wordpress.com</link>
	<description>A Memory beyond the life.</description>
	<lastBuildDate>Thu, 13 Nov 2008 08:11:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='iamtechie.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Techie's Blog</title>
		<link>http://iamtechie.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://iamtechie.wordpress.com/osd.xml" title="Techie&#039;s Blog" />
	<atom:link rel='hub' href='http://iamtechie.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Read and Write Text File in Asp.Net with C#</title>
		<link>http://iamtechie.wordpress.com/2008/11/12/read-and-write-text-file-in-aspnet-with-c/</link>
		<comments>http://iamtechie.wordpress.com/2008/11/12/read-and-write-text-file-in-aspnet-with-c/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 08:37:59 +0000</pubDate>
		<dc:creator>iamtechie</dc:creator>
				<category><![CDATA[Asp.Net]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://iamtechie.wordpress.com/?p=5</guid>
		<description><![CDATA[  Read and Write Text File in Asp.Net with C#                In C# when ever you want to do text file related operation than it’s very easy to do with lots of class and methods. All the Class file related to File Input Output operation are inside the System.IO name space. So, before writing anything [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamtechie.wordpress.com&amp;blog=5490140&amp;post=5&amp;subd=iamtechie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"> </p>
<p class="MsoNormal"><strong><span>Read and Write Text File in Asp.Net with C#</span></strong></p>
<p class="MsoNormal"><span><span>               </span></span></p>
<p class="MsoNormal"><span>In C# when ever you want to do text file related operation than it’s very easy to do with lots of class and methods. All the Class file related to File Input Output operation are inside the System.IO name space. So, before writing anything in file just add name space to file using following line</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span>using</span><span> System.IO;</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>In this name space there are two classes TextWriter to write the text file and TextReader to read the file.</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><strong><span>Writing something into text file</span></strong></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>// Declare instance of writer class with following line </span></p>
<p class="MsoNormal"><span>TextWriter</span><span> tw = <span>new</span> <span>StreamWriter</span>(<span>&#8220;File.Text&#8221;</span>);</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>// In the above line we are declaring one text write and asign stream // writer to it.</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>// write three line of text to the file</span></p>
<p class="MsoNormal"><span>tw.WriteLine(<span>“My Name is Tarun </span>\n”);</span></p>
<p class="MsoNormal"><span>tw.WriteLine(“<span>I am 25 year Old. </span>\n”);<span></span></span></p>
<p class="MsoNormal"><span>tw.WriteLine(“<span>This file is wriiten at “ + DateTime</span>.Now + “ \n”);</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>// close the stream</span></p>
<p class="MsoNormal"><span>tw.Close();</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>Now your file is ready to use. But we want to read it progra mmatically </span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>Most of the thing is same to read the file just we have to declare TextReader class rather than TextWriter</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>Here is the code to </span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><strong><span>Reading</span></strong><strong><span> the whole file</span></strong></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>// Declare one line variable with type string</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>string</span><span> line = <span>&#8220;&#8221;</span>;</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>// Now decalre TextReader class instance and open File.txt in memory stream.</span></p>
<p class="MsoNormal"><span><span>  </span></span></p>
<p class="MsoNormal"><span>TextReader</span><span> tr = <span>new</span> <span>StreamReader</span>(<span>&#8220;File.Text&#8221;</span>);</span></p>
<p class="MsoNormal"><span>// Now loop through all the line inside file and display one by one on the screen using Response.Write() Method.</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span><span>        </span><span>while</span> ((line = tr.ReadLine()) != <span>null</span>)</span></p>
<p class="MsoNormal"><span><span>        </span>{</span></p>
<p class="MsoNormal"><span><span>            </span>Response.Write(tr.ReadLine()+<span>&#8220;&lt;br&gt;&#8221;</span>);</span></p>
<p class="MsoNormal"><span><span>        </span>}</span></p>
<p class="MsoNormal"><span><span>        </span>tr.Close();</span></p>
<p class="MsoNormal"><span><span>            </span></span></p>
<p class="MsoNormal"><span>In TextReader and Text Write class there are more methods to check file is there? When it is created? Who is the author, when last modify? Is it read only or not and many more just check one by one. You can manage total file handaling operation with this two class vry effectively.</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span><br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamtechie.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamtechie.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamtechie.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamtechie.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamtechie.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamtechie.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamtechie.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamtechie.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamtechie.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamtechie.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamtechie.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamtechie.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamtechie.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamtechie.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamtechie.wordpress.com&amp;blog=5490140&amp;post=5&amp;subd=iamtechie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamtechie.wordpress.com/2008/11/12/read-and-write-text-file-in-aspnet-with-c/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">iamtechie</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom Paging in Asp.Net with Data Grid or Grid View</title>
		<link>http://iamtechie.wordpress.com/2008/11/12/custom-paging-in-aspnet-with-data-grid-or-grid-view/</link>
		<comments>http://iamtechie.wordpress.com/2008/11/12/custom-paging-in-aspnet-with-data-grid-or-grid-view/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 06:59:41 +0000</pubDate>
		<dc:creator>iamtechie</dc:creator>
				<category><![CDATA[Asp.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Add new tag]]></category>

		<guid isPermaLink="false">http://iamtechie.wordpress.com/?p=3</guid>
		<description><![CDATA[Custom Paging in Asp.Net with Data Grid or Grid View Purpose: When ever in any large application lots of data are there, and we want to display all the data on the page so long scroll will come, and might be some alignment issue can arise. For that purpose to display some specific no of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamtechie.wordpress.com&amp;blog=5490140&amp;post=3&amp;subd=iamtechie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><strong><span>Custom Paging in Asp.Net with Data Grid or Grid View</span></strong></p>
<p class="MsoNormal"><strong><span>Purpose:</span></strong></p>
<p class="MsoNormal"><span>When ever in any large application lots of data are there, and we want to display all the data on the page so long scroll will come, and might be some alignment issue can arise. For that purpose to display some specific no of data on the page and at the bottom or top of the page display page no list so user can move easily on the specific page quickly.</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>But Grid view and Data grid is giving in built paging facility. So there is no need to develop it independently right? No it’s wrong; Let me come to the point, suppose we are developing any shopping cart application. In that application user is searching for particular item and that item is suppose mobile device. Now in store there are 1000 different models.<span>  </span>But you are displaying only 20,30 or 50 models on the page and then paging is there. But when ever you are retrieving data from database all 1000 record will come into result. On the client end rest of data will be eliminated by grid and display particular no of data on the page. So why we are retrieving extra data from database?, why we will use network bandwidth?, why we will <span> </span>create overhead on server, database and network? For that we need custom page to retrieve data effectively.</span></p>
<p class="MsoNormal"><strong><span>What is custom paging?</span></strong></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>Custom paging in the sense implement the paging facility in web page by programmatically. In this procedure how can we achieve this functionality just see it here. In our application when ever large amount of data is there to be displayed. Then write a Stored Procedure and pass two parameter one for page id and second for no of data. And from procedure retrieve specific no of data that’s it. It’s very simple. </span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>Here is the sample code for stored procedure.</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span>CREATE</span><span> <span>Procedure</span> [dbo]<span>.</span>[CustomePaging]</span></p>
<p class="MsoNormal"><span>&#8211; Declare parameters.</span></p>
<p class="MsoNormal"><span>@CurrPage <span>As</span> <span>int</span><span>,</span></span></p>
<p class="MsoNormal"><span>@PageSize <span>As</span> <span>int</span></span></p>
<p class="MsoNormal"><span>As</span></p>
<p class="MsoNormal"><span>Set</span><span> <span>NoCount</span> <span>On</span></span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>&#8211; Declare variables.</span></p>
<p class="MsoNormal"><span>Declare</span><span> @FRec <span>int</span></span></p>
<p class="MsoNormal"><span>Declare</span><span> @LRec <span>int</span></span></p>
<p class="MsoNormal"><span>&#8211; Initialize variables.</span></p>
<p class="MsoNormal"><span>Set</span><span> @FRec <span>=</span> <span>(</span>@CurrPage <span>-</span> 1<span>)</span> <span>*</span> @PageSize</span></p>
<p class="MsoNormal"><span>Set</span><span> @LRec <span>=</span> <span>(</span>@CurrPage <span>*</span> @PageSize <span>+</span> 1<span>)</span></span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>&#8211; Create a temporarily table to hold the current page of data</span></p>
<p class="MsoNormal"><span>&#8211;Guess we are retrieving from emp table name and age</span></p>
<p class="MsoNormal"><span>Create</span><span> <span>Table</span> #Temp</span></p>
<p class="MsoNormal"><span>(</span></p>
<p class="MsoNormal"><span>RecId <span>int</span> <span>IDENTITY</span> <span>PRIMARY</span> <span>KEY</span><span>,</span></span></p>
<p class="MsoNormal"><span>Emp_Name <span>varchar</span><span>(</span>100<span>),</span></span></p>
<p class="MsoNormal"><span>Emp_Age <span>int</span><span>)</span></span></p>
<p class="MsoNormal"><span>&#8211;Fill the temp table with the reminders</span></p>
<p class="MsoNormal"><span>Insert</span><span> <span>Into</span> #Temp </span></p>
<p class="MsoNormal"><span>(</span></p>
<p class="MsoNormal"><span>Emp_Name<span>,</span> Emp_Age<span>)</span></span></p>
<p class="MsoNormal"><span>Select</span><span> Emp_Name<span>,</span>Emp_Age <span>from</span> emp <span>Order</span> <span>By</span> Emp_Id <span>Desc</span> <span>&#8211; Assume Emp_Id is primary key</span></span></p>
<p class="MsoNormal"><span>&#8211;Select one page of data based on the record numbers above</span></p>
<p class="MsoNormal"><span>Select</span><span> <span>*</span> <span>From</span> #Temp <span>Where</span> RecId <span>&gt;</span> @FRec <span>And</span> RecId <span>&lt;</span> @LRec</span></p>
<p class="MsoNormal"><span>Drop</span><span> <span>Table</span> #Temp</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span>In above procedure we are passing two parameters CurrentPage and PageSize. On base upon we set First Record and Last record No. Then we create Temp Table select all the data from original table and insert into that temp table. From there we are retrieving all the data between First and Last Record. </span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>In webpage set CurrentPage=1 during page load event then put two arrow button on page like previous and next and on the click of that button set current page index either CurrentPage -1 or CurrentPage +1<span>  </span>and then again retrieve data and bind to grid or datagrid.</span></p>
<p class="MsoNormal"><span>Happy custom paging…………….</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span><br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamtechie.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamtechie.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamtechie.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamtechie.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamtechie.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamtechie.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamtechie.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamtechie.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamtechie.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamtechie.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamtechie.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamtechie.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamtechie.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamtechie.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamtechie.wordpress.com&amp;blog=5490140&amp;post=3&amp;subd=iamtechie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamtechie.wordpress.com/2008/11/12/custom-paging-in-aspnet-with-data-grid-or-grid-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">iamtechie</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://iamtechie.wordpress.com/2008/11/12/hello-world/</link>
		<comments>http://iamtechie.wordpress.com/2008/11/12/hello-world/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 05:52:24 +0000</pubDate>
		<dc:creator>iamtechie</dc:creator>
				<category><![CDATA[Asp.Net]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamtechie.wordpress.com&amp;blog=5490140&amp;post=1&amp;subd=iamtechie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamtechie.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamtechie.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamtechie.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamtechie.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamtechie.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamtechie.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamtechie.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamtechie.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamtechie.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamtechie.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamtechie.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamtechie.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamtechie.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamtechie.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamtechie.wordpress.com&amp;blog=5490140&amp;post=1&amp;subd=iamtechie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamtechie.wordpress.com/2008/11/12/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">iamtechie</media:title>
		</media:content>
	</item>
	</channel>
</rss>
