<?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/"
	>

<channel>
	<title>Sumit Gupta &#187; C#.NET</title>
	<atom:link href="http://www.sumitgupta.net/category/programming/cnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sumitgupta.net</link>
	<description>bookmarking my life</description>
	<lastBuildDate>Wed, 08 Feb 2012 11:23:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>GDI+ Generic Error</title>
		<link>http://www.sumitgupta.net/gdi-generic-error/</link>
		<comments>http://www.sumitgupta.net/gdi-generic-error/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 08:28:54 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[VB.NET/VB]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[GDI+]]></category>
		<category><![CDATA[Generic Error]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=534</guid>
		<description><![CDATA[I see lot of people asking about GDI+ Generic Error. Since this is &#8220;generic&#8221; error nobody can tell what is wrong with code. So did a work around and get it working. I had this error quite a time in early days of my programming and just found same error in one of junior&#8217;s code. [...]]]></description>
			<content:encoded><![CDATA[<p>I see lot of people asking about GDI+ Generic Error. Since this is &#8220;generic&#8221; error nobody can tell what is wrong with code. So did a work around and get it working. I had this error quite a time in early days of my programming and just found same error in one of junior&#8217;s code. Well from my experience I can say one thing. GDI+ Generic error 99.9% means &#8220;developer miss a detail or overlooked something&#8221;. Most common reason of error are negligence of</p>
<p>1. Path should be physical path</p>
<p>2. All folder should present before you create file.</p>
<p>3. Previous files should be in write mode if case of overriding files.</p>
<p>4. Make sure permission are for writing to User of process.</p>
<p>5. Do not include any special character which windows do not permit in folder name or file name.</p>
<p>6. FILE FORMAT has nothing to do with this error most often.</p>
<p>7. Recheck permission if you try all above.</p>
<p>8. Recheck Path again <img src='http://www.sumitgupta.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Point #7 and #8 are most important solution and always works for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/gdi-generic-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Static Object in ASP.NET</title>
		<link>http://www.sumitgupta.net/static-object-in-asp-net/</link>
		<comments>http://www.sumitgupta.net/static-object-in-asp-net/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 12:03:22 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Concept/algorithm]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[VB.NET/VB]]></category>
		<category><![CDATA[SQLConnection]]></category>
		<category><![CDATA[Static Object]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=520</guid>
		<description><![CDATA[Recently I found a problem in one of application we developed. Here my colleague use a Static SqlConnection object through a class in his code. He did that to save his effort of writing and Connection everytime. Everything works great during our development and online reviewing. However as soon as we lauch website in beta [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I found a problem in one of application we developed. Here my colleague use a Static SqlConnection object through a class in his code. He did that to save his effort of writing and Connection everytime. Everything works great during our development and online reviewing. However as soon as we lauch website in beta mode, it start creating problem which seems bit random in occurance and hence were hard to track. During this time I get involve in the project development and I was not very big fan on Static object and start to think against that code, which looks good to me at first. However for some reason I miss the basic of C# and ASP.NET and hence it took a while to recognize the problem was indeed the static code. So for those who did same mistake here is explanation of why Static object didn&#8217;t work in ASP.NET for connection.</p>
<p>When ASP.NET application is first called the complete code is loaded in Memory, specially the pages in App_Code folder and they act as part of web server and not as standard PHP site where they run and loaded on each request. Hence, once this happens all static object become static in memory for each and every request your server will get. This is indeed good way to share information between all User and all request, if that help your case. But in most general case you never want to share information between user in this dynamic method, which is not permanent. Anyways, for connection it really doesn&#8217;t make a difference if you share the object as you anyways want to open connection and close it as soon as you are done. In most case you have 1 simple insert or fetch query to run. And in a website with several users at a time it hardly make a difference as Sqlconnection are open and close in jiffy and took less than 1 second in most cases. For a shopping cart which has 100 -200 order per month this case will work just fine.</p>
<p>However, since connection is shared, there is every possible chance that if you fire a SQL query for say Reader, it get shared with some user on some other session and this is what you don&#8217;t want. It happens to our project when we have Bulk CSV upload which usually take 30-50 seconds, but if someone during this time fires and open other page of website they start to get random Database related errors. From SqlReader is close to field &#8220;Xyz&#8221; is not available, as they tend to share the connection with other requests.</p>
<p>Hope you avoid those problem. The colleague who did this in our project is not working with us anymore, but hey, where ever you are , please don&#8217;t punish us like this again !!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/static-object-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Session in ASP.NET handler Page</title>
		<link>http://www.sumitgupta.net/session-in-asp-net-handler-page/</link>
		<comments>http://www.sumitgupta.net/session-in-asp-net-handler-page/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 20:10:35 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=495</guid>
		<description><![CDATA[To use Session data in Handler Class you need to implement IRequiresSessionState which is part of Following namespace (using for helping copy/paste ) using System.Web.SessionState; Self reminder]]></description>
			<content:encoded><![CDATA[<p>To use Session data in Handler Class you need to implement</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">IRequiresSessionState</pre></div></div>

<p>which is part of Following namespace (using for helping copy/paste )</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.SessionState</span><span style="color: #008000;">;</span></pre></div></div>

<p>Self reminder <img src='http://www.sumitgupta.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/session-in-asp-net-handler-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET JavascriptSerializer for Array</title>
		<link>http://www.sumitgupta.net/asp-net-javascriptserializer-for-array/</link>
		<comments>http://www.sumitgupta.net/asp-net-javascriptserializer-for-array/#comments</comments>
		<pubDate>Sat, 28 May 2011 09:52:51 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[VB.NET/VB]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Serialize]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=484</guid>
		<description><![CDATA[I need to throw some database entry which are as simple as TIME, for this I got a string array in my ASP.NET code behind. I was throwing this String Array in JSON format after using JavascriptSerialize.Serialize method and it is making not so perfect Json script. I said it is not making perfect json [...]]]></description>
			<content:encoded><![CDATA[<p>I need to throw some database entry which are as simple as TIME, for this I got a string array in my ASP.NET code behind. I was throwing this String Array in JSON format after using JavascriptSerialize.Serialize method and it is making not so perfect Json script. I said it is not making perfect json because the expect result for me was something like this:</p>
<p>["10:20","10:30","10:40"]</p>
<p>but it was returing something like</p>
<p>{&#8220;d&#8221;:&#8221;[\"10:20\",\"10:30\",\"10:40\"]&#8220;}</p>
<p>the difference is that it is converting the array in to string, however the ideal result can be</p>
<p>{&#8220;d&#8221;:["10:20","10:30","10:40"]}</p>
<p>But we cannot change that functionality now, so what I realise we should use the eval function of javascript to make our Jquery or whatever JSON parse you are using. So my Jquery code looks like</p>
<blockquote>
<p>&#8230;.</p>
<p>success: function(data) {<br /> var items = [];<br /> $.each(data, function(ind, val) {<br /> var myobject = eval(val);<br /> $.each(myobject, function(i, v) {                    <br /> items.push(&#8216;&lt;option value=&#8221;&#8216; + v + &#8216;&#8221;&gt;&#8217; + v+ &#8216;&lt;/option&gt;&#8217;);<br /> });<br /> });<br /> }</p>
<p>&#8230;</p>
</blockquote>
<p>this convert the String to Javascript object using Eval function. Easy enough !!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/asp-net-javascriptserializer-for-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Read System TimeZone to DB</title>
		<link>http://www.sumitgupta.net/read-system-timezone-to-db/</link>
		<comments>http://www.sumitgupta.net/read-system-timezone-to-db/#comments</comments>
		<pubDate>Sat, 07 May 2011 17:22:58 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[TimeZone]]></category>
		<category><![CDATA[TimeZoneInfo]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=476</guid>
		<description><![CDATA[I was looking for the TimeZone Database which also need to told me if Given Timezone is DayLightSaving enabled or not. After searching few hours on Internet I found few database that do not tell the Daylight Saving stuff. Then I found a function in TimeZoneInfo class that list all System Timezone, I loop through [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking for the TimeZone Database which also need to told me if Given Timezone is DayLightSaving enabled or not. After searching few hours on Internet I found few database that do not tell the Daylight Saving stuff. Then I found a function in TimeZoneInfo class that list all System Timezone, I loop through it and got what I need.</p>
<blockquote>
<p>using (SqlCommand sqlCmd = new SqlCommand(&#8220;&#8221;, Connection.MyConnection))<br /> {<br /> sqlCmd.CommandText = &#8220;Insert into tblTimezone (TimeZone, TimeZoneDifference, isDST) Values(@TimeZone, @TimeZoneDifference, @isDST)&#8221;;<br /> sqlCmd.Connection = Connection.MyConnection;<br /> sqlCmd.Connection.Open();<br /> foreach (TimeZoneInfo tzi in TimeZoneInfo.GetSystemTimeZones())<br /> {<br /> sqlCmd.Parameters.Clear();<br /> sqlCmd.Parameters.AddWithValue(&#8220;@TimeZone&#8221;, tzi.DisplayName);<br /> sqlCmd.Parameters.AddWithValue(&#8220;@TimeZoneDifference&#8221;, tzi.BaseUtcOffset.ToString());<br /> sqlCmd.Parameters.AddWithValue(&#8220;@isDST&#8221;, (tzi.SupportsDaylightSavingTime ? 1 : 0));<br /> sqlCmd.ExecuteNonQuery();<br /> }<br /> sqlCmd.Connection.Close();<br /> sqlCmd.Dispose();<br /> }</p>
</blockquote>
<p>Keep it simple <img src='http://www.sumitgupta.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/read-system-timezone-to-db/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working Lot of new methodology</title>
		<link>http://www.sumitgupta.net/working-lot-of-new-methodology/</link>
		<comments>http://www.sumitgupta.net/working-lot-of-new-methodology/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 10:11:14 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Blog: My thoughts]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Joyous]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[WebService]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=439</guid>
		<description><![CDATA[It is good to back as programmer. Loving my new phase of development career, I got involved in development of a online card game. After lot of thinking and reading, I decide to use some new technology and methodology which I have been hearing about a lot. I don&#8217;t dare to use them as I [...]]]></description>
			<content:encoded><![CDATA[<p>It is good to back as programmer. Loving my new phase of development career, I got involved in development of a online card game. After lot of thinking and reading, I decide to use some new technology and methodology which I have been hearing about a lot. I don&#8217;t dare to use them as I feel the kind of project we were doing lately are not big enough to learn and implement those concepts. After for this project it really become necessity to these technology rather than just a decision making. For example to build a game UI, I have three option GDI+, DirectX or WPF.. I have done GDI+ before and doesn&#8217;t feel it is best to make complex Graphical interface even for like of poker game. Though I use it to build Chess Interface, but I know how problematic it was. Second came in DirectX, the best but the complex solution. I need more time to learn it and project is getting delayed. Then I choose to learn and work on WPF which is relatively easier than DirectX.</p>
<p>It was really a nice decision to choose WPF. It is not only easier for me to learn as I already have some experience in HTML and web programming, but it give me control which is best suited for programmer of my culture. With no efforts I am now able to create a better looking UI. Ofcourse I didn&#8217;t test the UI on Windowx XP yet, but otherwise it looks great. I am not going to test it on Windows XP anyways as we don&#8217;t going to support it. Once I have the UI ready. I need to now communicate with Online database. So for this I already know the solution called as Web Services. But where will I found the Web Service in Visual Studio 2010 .. oh I think they rename it as WCF.. nope, they make a new concept altogether called WCF. Hmm.. with past experience of webservice I know that it was the perfect solution for me, but again WCF is almost similar no difference to code, so what harm it does to use it. Afterall it bring some new security measure and ease. So I again learn WCF and it took me 1 hr to cover the difference between Web Service and WCF and I am up and ready with my solution.</p>
<p>Making game UI is really so exciting that I am now looking for opportunity to upgrade my Chess game to WPF interface. Programming is really fun with those concept of programming and tools that I learn in recent past. It was complex then before in planning, but easy to implement. However the attitude of programmer is they need something ease to plan and implementation they are not bothered. I must suggest using WPF and WCF in your project where you need them. I haven&#8217;t try but they says WPF and Silverlight has same code or reusable. Well if that is the case then surely I will start giving Silverlight solution in next quarter or so.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/working-lot-of-new-methodology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenXML : New office file format</title>
		<link>http://www.sumitgupta.net/openxml-new-office-file-format/</link>
		<comments>http://www.sumitgupta.net/openxml-new-office-file-format/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 10:28:33 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[VB.NET/VB]]></category>
		<category><![CDATA[file format]]></category>
		<category><![CDATA[Office 2007]]></category>
		<category><![CDATA[Office Open XML]]></category>
		<category><![CDATA[Open XML]]></category>
		<category><![CDATA[OpenXML]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=264</guid>
		<description><![CDATA[When I first heard that Microsoft change the file extension of MS Office Products and add &#8220;x&#8221; in them, I got surprised as that was not very common practise for me. But today when I word on that new file format, I really would say, it was a good move. Those who don&#8217;t know, Microsoft [...]]]></description>
			<content:encoded><![CDATA[<p>When I first heard that Microsoft change the file extension of MS Office Products and add &#8220;x&#8221; in them, I got surprised as that was not very common practise for me. But today when I word on that new file format, I really would say, it was a good move. Those who don&#8217;t know, Microsoft with Office 2007, has change the core of file format used by Office product, and with other office software getting popularity, they actually work on an Open File format/document format. This new file fomat is known as &#8220;office open XML&#8221; or OpenXML.</p>
<p>this file format is based on one idea, Create a XML of Data and formatting in file, zip it and save it. Simple and easy. This file format is not limted to MS Office, but OpenOffice.org understand it very well.</p>
<p>In my project I need to create an Excel file such that my user can generate a summary report in Excel fileformat on button click. All I need to do is add 10 more lines (Except data retrivel logic) in my software, include few library and I am done.</p>
<p>Thanks to <a href="http://simpleooxml.codeplex.com/">http://simpleooxml.codeplex.com/</a> which make my work easy, this is wrapper highlevel class based on Microsoft OpenXML Format SDK. which include some .NET assembly. This wrapper make it easy for you write Excel of Word document in few lines. A sample for ASP.NET is included from author, though I use it for Windows Application and it works like charm.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/openxml-new-office-file-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZedGraph Unlocked</title>
		<link>http://www.sumitgupta.net/zedgraph-unlocked/</link>
		<comments>http://www.sumitgupta.net/zedgraph-unlocked/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 06:25:39 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[VB.NET/VB]]></category>
		<category><![CDATA[Control]]></category>
		<category><![CDATA[Windows Form]]></category>
		<category><![CDATA[zedControl]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=230</guid>
		<description><![CDATA[I was working on reporting application where I just need to create graphs and paste them on PDF file. For this I choose ZedGraph Control. It is perfect library I found. Although no new development is done on it lately. But they have nothing to code in it anyways.  They have good wiki and active [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on reporting application where I just need to create graphs and paste them on PDF file. For this I choose ZedGraph Control. It is perfect library I found. Although no new development is done on it lately. But they have nothing to code in it anyways.  They have good wiki and active forum to discuss. Anyways, previously when I use this library for same situtation i was not very sure how I use it only to create Graph file on disk. What I did was I use a Hidden Control on my Window Form application with its visibilty set to false. then I draw Graph on it and save the graph from that hidden form. Since it is a control I doesn&#8217;t know if there is any better way of doing it is available or not.</p>
<p>But today I thought to experiment a bit. I simply create a Class file in my application, import ZedLibrary in that class file. Create an object of ZedGraph Control within my class, Set all values that are set in my old application&#8217;s initilizecomponent function, and create disk graph as I do previously. And it works!!! i know this sound &#8220;obvious&#8221; thing to whom that know a control cannot be used without making its instance on form. But for those who are not very mature like me, they might not know this. Also, some controls are graphic bound (due to bad coding only). But seriously ZedControl is perfect in that manner.  </p>
<p>I learn a new thing today in .NET framework, that really tells why it is true object oriented and what we see on screen is only CODE at the end of day, so there is nothing to worries about the display if you can control it through property and methods.  </p>
<p>Now let me finish my project first <img src='http://www.sumitgupta.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/zedgraph-unlocked/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ZedGraph</title>
		<link>http://www.sumitgupta.net/zedgraph/</link>
		<comments>http://www.sumitgupta.net/zedgraph/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 05:09:06 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Bookmarked]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[VB.NET/VB]]></category>
		<category><![CDATA[BarGraph]]></category>
		<category><![CDATA[Chart]]></category>
		<category><![CDATA[Graph Library]]></category>
		<category><![CDATA[Pie Graph]]></category>
		<category><![CDATA[ZedGraph]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=224</guid>
		<description><![CDATA[Recently I finish a .NET 3.5 based desktop application, where I need to make graphs. For this I search few open source, ready to use library and with help of SourceForge.net, I am able to find one such good library called ZEDGraph. However, it seems this project is no longer active, but it has a [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I finish a .NET 3.5 based desktop application, where I need to make graphs. For this I search few open source, ready to use library and with help of <a title="source forge open source projects" href="http://www.SourceForge.net" target="_blank">SourceForge.net</a>, I am able to find one such good library called ZEDGraph. However, it seems this project is no longer active, but it has a good reason that they might not have any new thing to add as it seems already full of features.</p>
<p>You can go to <a title="Zedgraph wiki" href="http://www.zedgraph.org/wiki/index.php?title=Main_Page" target="_blank">ZedGraph Wiki</a>, or can ask question on its sourceforge forum which still is somewhat active and people are posting there.</p>
<p>This is really a good project and I will stick with it as I modify its source as well for one of very own custom requirement and hence I know its source architecture to us it in future as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/zedgraph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Progress bar for long running ASP.NET scripts</title>
		<link>http://www.sumitgupta.net/progress-bar-for-long-running-aspnet-scripts/</link>
		<comments>http://www.sumitgupta.net/progress-bar-for-long-running-aspnet-scripts/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 11:26:31 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[VB.NET/VB]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=50</guid>
		<description><![CDATA[Though I have posted in my old blog, but just to keep track of this..  http://www.aspfree.com/c/a/VB.NET/Executing-LongRunning-Tasks-with-the-Progress-Bar-in-ASPNET/ This article suggest a method on how to show progress bar in your web application.]]></description>
			<content:encoded><![CDATA[<p>Though I have posted in my old blog, but just to keep track of this..</p>
<p>  <a href="http://www.aspfree.com/c/a/VB.NET/Executing-LongRunning-Tasks-with-the-Progress-Bar-in-ASPNET/">http://www.aspfree.com/c/a/VB.NET/Executing-LongRunning-Tasks-with-the-Progress-Bar-in-ASPNET/</a></p>
<p>This article suggest a method on how to show progress bar in your web application.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/progress-bar-for-long-running-aspnet-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Printing Text Document in .NET 2.0</title>
		<link>http://www.sumitgupta.net/printing-text-document-in-net-20/</link>
		<comments>http://www.sumitgupta.net/printing-text-document-in-net-20/#comments</comments>
		<pubDate>Tue, 10 Jul 2007 05:44:29 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[VB.NET/VB]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=43</guid>
		<description><![CDATA[Some time reporting tools are too heavy to use with a small application. Something similar happens with me, I need to print a Single page text information for this I cannot use any Heavy reporting software although this information is fetched from XML/Database. So I opt to use in built .NET feature and having following [...]]]></description>
			<content:encoded><![CDATA[<p>Some time reporting tools are too heavy to use with a small application. Something similar happens with me, I need to print a Single page text information for this I cannot use any Heavy reporting software although this information is fetched from XML/Database. So I opt to use in built .NET feature and having following for you to use now.</p>
<p>  First Add a <strong>PrintDialog </strong>box on your Windows Application that gives printing capability.</p>
<p>Now Include a Object with its events in your code</p>
<p><em><code>Private WithEvents doctoprint As New Printing.PrintDocument</code></em></p>
<p>Once we have these basic Set up now, we can simply copy paste given two function on page to Print document define in FILE_PATH constant</p>
<pre>Private Sub PrintDocument()
PrintText.AllowSomePages = False
PrintText.AllowSelection = False
 PrintText.ShowHelp = False
 PrintText.Document = doctoprint

 Dim result As DialogResult = PrintText.ShowDialog

 If result = Windows.Forms.DialogResult.OK Then
 Try
 streamToPrint = New StreamReader(FILE_PATH)
 doctoprint.DocumentName = "Title to Show on 'Now printing dialog'"
 doctoprint.Print()
 streamToPrint.Close()
 Catch ex As Exception
 MsgBox("Unable to print")
 End Try
 End If
 End Sub

 Private Sub doctoprint_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles doctoprint.PrintPage

'change this line tochange default font for printing.
 Dim printFont As New System.Drawing.Font("Arial", 10, System.Drawing.FontStyle.Regular)

 Dim linesPerPage As Single = 0
 Dim yPos As Single = 0
 Dim count As Integer = 0
 Dim leftMargin As Single = e.MarginBounds.Left
 Dim topMargin As Single = e.MarginBounds.Top
 Dim line As String = Nothing

 ' Calculate the number of lines per page.
 linesPerPage = e.MarginBounds.Height / printFont.GetHeight(e.Graphics)

 ' Print each line of the file.
 While count &lt; linesPerPage
 line = streamToPrint.ReadLine()
 If line Is Nothing Then
 Exit While
 End If
 yPos = topMargin + count * printFont.GetHeight(e.Graphics)
 e.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, New StringFormat())
 count += 1
 End While

 ' If more lines exist, print another page.
 If Not (line Is Nothing) Then
 e.HasMorePages = True
 Else
 e.HasMorePages = False
 End If
 End Sub</pre>
<p>Now, simply call your <strong><em>PrintDocument()</em></strong> function to start printing of <strong><em>FILE_PATH</em></strong> using your Print Button or menu option.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/printing-text-document-in-net-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Schedular application in Windows</title>
		<link>http://www.sumitgupta.net/creating-schedular-application-in-windows/</link>
		<comments>http://www.sumitgupta.net/creating-schedular-application-in-windows/#comments</comments>
		<pubDate>Sat, 16 Jun 2007 05:17:33 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Server Configuration]]></category>
		<category><![CDATA[VB.NET/VB]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=42</guid>
		<description><![CDATA[This can be done in many ways. Often I see my collegues doing a ASP script that they schedule to run with Browser. As this seems quite obvious thing for them. An ASP scripts can run better in browser when called through IIS, and they can then schedule to run at given time and calling [...]]]></description>
			<content:encoded><![CDATA[<p>This can be done in many ways. Often I see my collegues doing a ASP script that they schedule to run with Browser. As this seems quite obvious thing for them. An ASP scripts can run better in browser when called through IIS, and they can then schedule to run at given time and calling ASP page of their.</p>
<p>But this is a wrong way of doing it. Why? first, it will open your Web browser at given time, if you are on desktop machine you will see that browser popup and then navigate to your give url. Second, mostly commonly people put website url to their script such as <a href="http://www.example.com/work.asp">http://www.example.com/work.asp</a> instead of <a href="http://localhost/work.asp">http://localhost/work.asp</a>, this will cause your bandwidth consumption for no reason. Takes more memory then needed. and finally, it will time out if you have long execution to do.</p>
<p>So, what you need to do. My best bet is create your own Windows Service and install it, if your shared hosting doesn&#8217;t provide that feature, then make EXEcutable file and let your hoster schedule it for you. This file once schedule will do your desire work.</p>
<p>If you are using ASP.NET then it has some inbuilt support for threading, that you can start and then put in memory to run forever. However, I never work on this part but see it in action for software like DOTNETNUKE etc.</p>
<p>Suggest anyother method if you can please.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/creating-schedular-application-in-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending inline Image using C#.NET</title>
		<link>http://www.sumitgupta.net/sending-inline-image-using-cnet/</link>
		<comments>http://www.sumitgupta.net/sending-inline-image-using-cnet/#comments</comments>
		<pubDate>Sat, 06 Jan 2007 11:53:02 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/blog/2007/01/06/sending-inline-image-using-cnet/</guid>
		<description><![CDATA[Recently i have to send an inline image in my outgoing automated email. I don&#8217;t know that it was that easy.. Read this article for sending inline image using C#.NET Sumit Gupta]]></description>
			<content:encoded><![CDATA[<p>Recently i have to send an inline image in my outgoing automated email. I don&#8217;t know that it was that easy..</p>
<p>Read this article for <a title="Sending inline image using C#.NET" href="http://blog.devexperience.net/en/12/Send_an_Email_in_CSharp_with_Inline_attachments.aspx" target="_blank">sending inline image using C#.NET</a></p>
<p>Sumit Gupta</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/sending-inline-image-using-cnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two Forms in ASP.Net</title>
		<link>http://www.sumitgupta.net/two-forms-in-aspnet/</link>
		<comments>http://www.sumitgupta.net/two-forms-in-aspnet/#comments</comments>
		<pubDate>Tue, 05 Sep 2006 01:44:00 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[VB.NET/VB]]></category>

		<guid isPermaLink="false">http://vikasumit.wordpress.com/2006/09/05/two-forms-in-aspnet/</guid>
		<description><![CDATA[Hi, As any other ASP.Net developer, I was not feeling comfortable with only one form concept that ASP.Net has (not sure about v2.0 as never work on it). Also, when you have to put something like google Search or other such service on your Site and place for such &#8220;explicit&#8221; forms are in middle of [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>As any other ASP.Net developer, I was not feeling comfortable with only one form concept that ASP.Net has (not sure about v2.0 as never work on it). Also, when you have to put something like google Search or other such service on your Site and place for such &#8220;explicit&#8221; forms are in middle of your Only &#8220;<span style="font-weight:bold;">Runat Server form</span>&#8221; how will you put the other forms &#8230;</p>
<p>Well what I did is simply use IFrame, capabilities of web browsers. I simply make a HTML page of Google search, and using IFrame call that page. now since it load explicit HTML page, you don&#8217;t have to worry about nested form, but simply about how it looks.</p>
<p>though It has a disadvantage that , on older browser your site might not be viewable, but who cares about old stuffs &#8230; every body you should get new browser after all browser are free <img src='http://www.sumitgupta.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Sumit Gupta</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/two-forms-in-aspnet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

