<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-37107620</id><updated>2011-11-28T05:40:09.851+05:30</updated><category term='SQL TOP PERCENT'/><category term='named c#'/><category term='Rules to Better Websites Navigation'/><category term='optional arguments c#'/><category term='32-Bit'/><category term='Shiran'/><category term='sql charset'/><category term='SQL  PERCENT'/><category term='IIS 7'/><category term='XSD'/><category term='64-Bit'/><category term='first letter'/><category term='Websites Navigation'/><category term='Numeric Only'/><category term='C# 4.0 optional parameters'/><category term='.Net'/><category term='lile'/><category term='not like'/><category term='Enable session state on a Web Methods'/><category term='Navigation'/><category term='dataset'/><category term='Limiting Textarea length'/><category term='Windows'/><category term='DIALOG BOX'/><category term='Radio Button'/><category term='C# INPUT'/><category term='PERCENT'/><category term='C# ConnectionStringBuilders'/><category term='Web service'/><category term='C#'/><category term='stoed procedure return value'/><category term='Visual Studio 2010 Beta 2'/><category term='&apos;[]%&apos;'/><category term='input dialog box'/><category term='vs2010'/><category term='Scott Guthie'/><category term='check box'/><category term='rare validation'/><category term='sql 2008'/><category term='encapsulation'/><category term='ORDER BY'/><category term='ConnectionStringBuilders'/><category term='dataset and return value'/><category term='OOP with C#'/><title type='text'>Shiran's Blog</title><subtitle type='html'>.net, Personal Views &amp;amp; Experiences</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>49</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-37107620.post-7919279508090519411</id><published>2011-09-08T11:10:00.000+05:30</published><updated>2011-09-08T11:11:11.744+05:30</updated><title type='text'>Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized.</title><content type='html'>&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-7919279508090519411?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/7919279508090519411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=7919279508090519411' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/7919279508090519411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/7919279508090519411'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2011/09/cannot-evaluate-expression-because.html' title='Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized.'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-8633157492626264057</id><published>2011-02-01T16:32:00.001+05:30</published><updated>2011-02-01T16:32:02.663+05:30</updated><title type='text'>Gridview RowEditing checkbox value</title><content type='html'>&lt;p&gt;We know if we have manually binds the data then, we can access the checkbox or what ever the control by it's id.   &lt;br /&gt;as follows &lt;/p&gt;  &lt;pre class="csharpcode"&gt;CheckBox ck = (CheckBox)GridView1.Rows[e.NewEditIndex].Cells[8].FindControl(&lt;span class="str"&gt;&amp;quot;yourCheckBoxControl&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;What if you auto bided the data to a gridview,&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;CheckBox ck = (CheckBox)GridView1.Rows[e.NewEditIndex].Cells[8].Controls[0];&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-8633157492626264057?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/8633157492626264057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=8633157492626264057' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8633157492626264057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8633157492626264057'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2011/02/gridview-rowediting-checkbox-value.html' title='Gridview RowEditing checkbox value'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-7216183689192019692</id><published>2011-01-26T23:02:00.001+05:30</published><updated>2011-01-30T20:23:57.033+05:30</updated><title type='text'>DropDownList - Set selected value</title><content type='html'>&lt;p&gt;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;br /&gt;The following code snippent shows how to set the selected item of a&lt;br /&gt;DropdownList&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;DropDownList1.ClearSelection();&lt;br /&gt;ListItem li = DropDownList1.Items.FindByValue(&amp;quot;20&amp;quot;); &lt;br /&gt;DropDownList1.Items.FindByText(li.Text).Selected = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;I have seen many beginners are struggling to set the selected value  dynamically,&lt;br /&gt;Hope this is very helpful.&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-7216183689192019692?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/7216183689192019692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=7216183689192019692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/7216183689192019692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/7216183689192019692'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2011/01/dropdownlist-set-selected-value.html' title='DropDownList - Set selected value'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-8147771336134800639</id><published>2011-01-16T14:24:00.001+05:30</published><updated>2011-01-16T14:24:58.824+05:30</updated><title type='text'>The report you requested requires further information</title><content type='html'>&lt;p&gt;This issue is a common one who starts working on Crystal Reports with Dataset (.Net)&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_8EXfgyXF23E/TTKyXGijVSI/AAAAAAAAEdI/k3aETsye27A/s1600-h/loginerror%5B3%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="loginerror" src="http://lh4.ggpht.com/_8EXfgyXF23E/TTKyYKblFHI/AAAAAAAAEdM/yE-7wXnKT-8/loginerror_thumb%5B1%5D.jpg?imgmax=800" width="449" height="167"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Ill show a sample code snippet where you can generate this issue.&lt;br&gt;&lt;/p&gt;&lt;pre class="csharpcode"&gt;                 ReportDocument report = &lt;span class="kwrd"&gt;new&lt;/span&gt; ReportDocument();    &lt;br /&gt;&lt;br /&gt;                 BAgent bAgent = &lt;span class="kwrd"&gt;new&lt;/span&gt; BAgent();&lt;br /&gt;                 DataSet dsStatus = &lt;span class="kwrd"&gt;new&lt;/span&gt; DataSet();&lt;br /&gt;                 dsStatus = bAgent.GetStatus();&lt;br /&gt;&lt;br /&gt;                 &lt;span class="kwrd"&gt;string&lt;/span&gt; reportPath = Server.MapPath(&lt;span class="str"&gt;"/Agent/Reports/GetStatusRpt.rpt"&lt;/span&gt;);  &lt;br /&gt;                 report.Load(reportPath);&lt;br /&gt;&lt;br /&gt;                 report.SetDataSource(dsStatus);&lt;span class="rem"&gt;// this is the line cause for this issue&lt;br&gt;&lt;/span&gt;                CrystalReportViewer1.ReportSource = report;  &lt;br /&gt;                 CrystalReportViewer1.DataBind();  &lt;br /&gt;                 CrystalReportViewer1.RefreshReport(); &lt;/pre&gt;&lt;pre class="csharpcode"&gt;&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt; Here is the solution, use the datset table instead of the dataset&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="csharpcode"&gt;                 ReportDocument report = &lt;span class="kwrd"&gt;new&lt;/span&gt; ReportDocument();    &lt;br /&gt;&lt;br /&gt;                 BAgent bAgent = &lt;span class="kwrd"&gt;new&lt;/span&gt; BAgent();&lt;br /&gt;                 DataSet dsStatus = &lt;span class="kwrd"&gt;new&lt;/span&gt; DataSet();&lt;br /&gt;                 dsStatus = bAgent.GetStatus();&lt;br /&gt;&lt;br /&gt;                 &lt;span class="kwrd"&gt;string&lt;/span&gt; reportPath = Server.MapPath(&lt;span class="str"&gt;"/Agent/Reports/GetStatusRpt.rpt"&lt;/span&gt;);  &lt;br /&gt;                 report.Load(reportPath);&lt;br /&gt;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;                 &lt;strong&gt;report.SetDataSource(dsStatus.Tables[0]); &lt;/strong&gt;&lt;span class="rem"&gt;&lt;br&gt;&lt;/span&gt;                 CrystalReportViewer1.ReportSource = report;  &lt;br /&gt;                 CrystalReportViewer1.DataBind();  &lt;br /&gt;                 CrystalReportViewer1.RefreshReport(); &lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Hope you got rid from this issue. Enjoy coding.&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-8147771336134800639?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/8147771336134800639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=8147771336134800639' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8147771336134800639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8147771336134800639'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2011/01/report-you-requested-requires-further.html' title='The report you requested requires further information'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_8EXfgyXF23E/TTKyYKblFHI/AAAAAAAAEdM/yE-7wXnKT-8/s72-c/loginerror_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-8483247713168239754</id><published>2011-01-13T10:10:00.001+05:30</published><updated>2011-01-30T20:29:01.047+05:30</updated><title type='text'>GridView Hidden Column Data Access</title><content type='html'>&lt;p&gt;Again I faced an issue, as usual before .net version 2.0 I set a column's visibility property of a gridview to false.   &lt;br /&gt;If you are a developer by now you know why I did that. I know you guessed it. I just wanted to use that column's value    &lt;br /&gt;in one of my calculations, and didn't want to show it to the user.&lt;/p&gt;  &lt;p&gt;Grid is working fine it hides the column I wanted to hide, I am happy!., Suddenly I realized that I don't get the value from    &lt;br /&gt;the hidden (visibility= false) column's cell value in the following method.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;pre class="csharpcode"&gt; &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; grd_SelectedIndexChanged(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;      GridViewRow row = grd.SelectedRow;&lt;br /&gt;      &lt;span class="kwrd"&gt;string&lt;/span&gt; aValue = row.Cells[8].Text; &lt;span class="rem"&gt;//this is the column I set false visibility&lt;/span&gt;&lt;br /&gt; }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I was looking my coding deeply I am sure this is correct 100%, then what has gone wrong?&lt;br /&gt;  &lt;br /&gt;With 2.0 and above versions on .Net when you set a column of a gridview to visibility false&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;it doesn't&amp;#160; bind the data to this hidden column. You must be really disappointed hearing this &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;news, even I did. Wait you don't have to worry so long.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Don't set your column's property visibility to false in the design view. If you do so it will&lt;br /&gt;  &lt;br /&gt;call before the databind. When there is no column databing is not take place and ignores this hidden column.&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;Obvious we&amp;#160; don't get data (you are lucky only you didn't get the data, worse case this might throw an error)&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Trick to overcome this issue,&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;RowCreated event of a GridView takes place after the data binding, so we can do something like following &lt;br /&gt;  &lt;br /&gt;code snippet.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt; &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; grd_RowCreated(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, GridViewRowEventArgs e)&lt;br /&gt;{&lt;br /&gt;       e.Row.Cells[8].Visible = &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;br /&gt; }&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This hides the column, still you can access the cell value,&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt; &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; grd_SelectedIndexChanged(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;      GridViewRow row = grd.SelectedRow;&lt;br /&gt;      &lt;span class="kwrd"&gt;string&lt;/span&gt; aValue = row.Cells[8].Text; &lt;span class="rem"&gt;//I get the cell value, I am happy!&lt;br /&gt;&lt;/span&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Enjoy working on Gridview control,&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-8483247713168239754?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/8483247713168239754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=8483247713168239754' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8483247713168239754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8483247713168239754'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2011/01/gridview-hidden-column-data-access.html' title='GridView Hidden Column Data Access'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-2113138723994483896</id><published>2011-01-11T20:18:00.001+05:30</published><updated>2011-01-11T20:20:03.955+05:30</updated><title type='text'>ASP.Net Gridview column totals</title><content type='html'>&lt;p&gt;Most of the developers use repeater control, in case where they have to show the totals of a list&amp;#160; instead gridview control.   &lt;br /&gt;This is not that difficult to show the totals on the gridview itself on footer template. I will show the steps how to do this in this post.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Drag and drop a Gridview on your .aspx and bind the data.&lt;/p&gt;  &lt;p&gt;eg:&amp;#160; &lt;/p&gt;  &lt;p&gt;grd.DataSource = ds;   &lt;br /&gt;grd.DataBind();&lt;/p&gt;  &lt;p&gt;on above code snippet grd is the my Gridview name and ds is my dataset. (you can use any datasource as your convenience)&lt;/p&gt;  &lt;p&gt;Set the &lt;strong&gt;ShowFooter&lt;/strong&gt; property to &lt;strong&gt;True&lt;/strong&gt; of the GridView, this will show the footer on the Gridview.&lt;/p&gt;  &lt;p&gt;Write the RowDataBound&amp;#160; event as follows, you can change the way you want. (in the following scenario I have not showed the declaration of chkAmount and transCharge&amp;#160; &lt;br /&gt;decimal type variables, these two are class level varibles)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;pre class="csharpcode"&gt;        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; grd_RowDataBound(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, GridViewRowEventArgs e)&lt;br /&gt;        {&lt;br /&gt;          &lt;br /&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (e.Row.RowType == DataControlRowType.DataRow)&lt;br /&gt;            {                &lt;br /&gt;                chkAmount += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem,  &lt;span class="str"&gt;&amp;quot;ChkAmount&amp;quot;&lt;/span&gt;));&lt;br /&gt;                transCharge += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, &lt;span class="str"&gt;&amp;quot;TransCharge&amp;quot;&lt;/span&gt;));&lt;br /&gt;            }&lt;br /&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (e.Row.RowType == DataControlRowType.Footer) &lt;span class="rem"&gt;// this is the footer identification&lt;/span&gt;&lt;br /&gt;            {&lt;br /&gt;                e.Row.Cells[4].Text = &lt;span class="str"&gt;&amp;quot;Totals:&amp;quot;&lt;/span&gt;;&lt;br /&gt;                &lt;span class="rem"&gt;// display totals on cells (in my case I have selected last 3 columns)&lt;/span&gt;&lt;br /&gt;                e.Row.Cells[6].Text = chkAmount.ToString(&lt;span class="str"&gt;&amp;quot;N2&amp;quot;&lt;/span&gt;);               &lt;br /&gt;                e.Row.Cells[5].Text = transCharge.ToString(&lt;span class="str"&gt;&amp;quot;N2&amp;quot;&lt;/span&gt;);&lt;br /&gt;                &lt;br /&gt;            }           &lt;br /&gt;        }      &lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Hope this is really easier when it comes to show totals on Gridview footer area . Please refer the following image which is the output of my above coding effort.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_8EXfgyXF23E/TSxuFb6tMHI/AAAAAAAAEdA/QOF_A_WXLgA/s1600-h/gridview-column-totals%5B4%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="gridview-column-totals" src="http://lh5.ggpht.com/_8EXfgyXF23E/TSxuGqE-m4I/AAAAAAAAEdE/ezqAgELr7zw/gridview-column-totals_thumb%5B2%5D.jpg?imgmax=800" width="729" height="86" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-2113138723994483896?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/2113138723994483896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=2113138723994483896' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/2113138723994483896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/2113138723994483896'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2011/01/aspnet-gridview-column-totals.html' title='ASP.Net Gridview column totals'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_8EXfgyXF23E/TSxuGqE-m4I/AAAAAAAAEdE/ezqAgELr7zw/s72-c/gridview-column-totals_thumb%5B2%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-5476397402381291839</id><published>2010-09-20T09:47:00.007+05:30</published><updated>2010-09-20T10:37:49.600+05:30</updated><title type='text'>Rename IIS7 application (Virtual directory)</title><content type='html'>This command will rename an existing directory on IIS7,&lt;br /&gt;&lt;br /&gt;C:&gt; %systemroot%\system32\inetsrv\appcmd set app "Default Web Site/OldApplicationName" -path:/NewApplicationName&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8EXfgyXF23E/TJbsEDXTeyI/AAAAAAAAEco/t6uvF7u9hwg/s1600/rename.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 31px;" src="http://4.bp.blogspot.com/_8EXfgyXF23E/TJbsEDXTeyI/AAAAAAAAEco/t6uvF7u9hwg/s400/rename.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5518857947755805474" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You just have to change OldApplicationName and NewApplicationName as per your requirement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-5476397402381291839?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/5476397402381291839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=5476397402381291839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/5476397402381291839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/5476397402381291839'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/09/rename-iis7-application-virtual.html' title='Rename IIS7 application (Virtual directory)'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_8EXfgyXF23E/TJbsEDXTeyI/AAAAAAAAEco/t6uvF7u9hwg/s72-c/rename.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-2218211560015294061</id><published>2010-08-03T09:26:00.004+05:30</published><updated>2010-08-03T09:39:51.551+05:30</updated><title type='text'>.NET Entity Data Model template missing</title><content type='html'>I may be bit late, but I thought I must give a try on a MVC Architecture Model.&lt;br /&gt;So, as I do always started to write a sort of "Hello World" app. When I try to create the ADO.NET Entity Data Model, I could not find ADO.NET Entity Data Model template.&lt;br /&gt;Is something wrong here? yep, we need to install Microsoft Visual Studio 2008 Service Pack 1 (iso). Here we go I have ADO.NET Entity Data Model template under my  Data category.&lt;br /&gt;&lt;br /&gt;There is more than one way...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-2218211560015294061?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/2218211560015294061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=2218211560015294061' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/2218211560015294061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/2218211560015294061'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/08/net-entity-data-model-template-missing.html' title='.NET Entity Data Model template missing'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-1520965090565245923</id><published>2010-07-28T11:15:00.002+05:30</published><updated>2010-07-28T11:35:07.238+05:30</updated><title type='text'>Page load twice</title><content type='html'>I know you may have already frustrated of this issue. Even I was really fed up when I came a cross this weird issue. I was facing this issue when I test my web application with Firefox 3.6.6, I did not check with any previous versions (and I found no issues with IE and some other browsers). Believe me it takes a lot of time to cure this. There are many possibilities but mine was a bad CSS practice, you may be wondering how CSS reloads the whole web page.&lt;br /&gt;This was the issue in my CSS code &lt;b&gt;background-image:url('')&lt;/b&gt;, having a empty image URL.&lt;br /&gt;I thought reloading the page twice an issue with my coding on page behind, but ultimately it was a CSS issue.&lt;br /&gt;&lt;br /&gt;Let me tel me why an empty URL gives such a major issue. Once the page loads the firefox still tries to find the empty URLs so page loads twice but IE just replaces the empty URL with null value.&lt;br /&gt;&lt;br /&gt;As I mentioned above this may not the exact cause for your problem but one of the following might cause your issue. Please visit the following URL (http://www.110mb.com/forum/how-to-stop-firefox-dual-pageloads-t27704.0.html) to see more possibilities. Hope this guides you to find the issue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-1520965090565245923?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/1520965090565245923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=1520965090565245923' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/1520965090565245923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/1520965090565245923'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/07/page-load-twice.html' title='Page load twice'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-8444203531222285276</id><published>2010-07-19T17:16:00.002+05:30</published><updated>2010-07-19T17:27:22.928+05:30</updated><title type='text'>must be placed inside a form tag with runat=server</title><content type='html'>I got to explain the scenario I cameacross this issue, as this might vary for some other scenarios. I got this error when I try to override the PreRender event of the masterpage's&lt;br /&gt;Content Holder (idea was to get the html of that area what evel loding in to that). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ContentPlaceHolder cph = (ContentPlaceHolder)Master.Controls[0].FindControl("master_content_holder");&lt;br /&gt;var sb = new StringBuilder();&lt;br /&gt;var sw = new StringWriter(sb);&lt;br /&gt;var htmlTxtWr = new HtmlTextWriter(sw);&lt;br /&gt;SmtpUtil smtpUtil = new SmtpUtil();            &lt;br /&gt;cph.RenderControl(htmlTxtWr);&lt;br /&gt;&lt;br /&gt;I got this error exactly on the last line of code. As error message states our all controlls must be inside a form tag with runat = server (note you can't have form tags on child pages, do not try it, it won't work). I did a small dirty work as to fix this issue.&lt;br /&gt;I just overrided the VerifyRenderingInServerForm mehtod on child page. For me it worked properly, as i didn't have any verification to be done on my page. Be carefull before use.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-8444203531222285276?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/8444203531222285276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=8444203531222285276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8444203531222285276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8444203531222285276'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/07/must-be-placed-inside-form-tag-with.html' title='must be placed inside a form tag with runat=server'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-6071532549673413540</id><published>2010-07-15T22:29:00.001+05:30</published><updated>2010-07-15T22:31:48.836+05:30</updated><title type='text'>Drop emails in a folder</title><content type='html'>&lt;p&gt;&lt;br&gt;Instead sending an email we can configure the web.config to drop the mail in a local folder.&lt;br&gt;This is a good feature when it come to testing email on your application while developing.&lt;/p&gt; &lt;p&gt;Just add the following on the web.config&lt;/p&gt; &lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;   &amp;lt;system.net&amp;gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;     &amp;lt;mailSettings&amp;gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;       &amp;lt;smtp deliveryMethod=&lt;span class="str"&gt;"SpecifiedPickupDirectory"&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;      &amp;lt;specifiedPickupDirectory pickupDirectoryLocation="C:\testmails\"/&amp;gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;       &amp;lt;/smtp&amp;gt;            &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;     &amp;lt;/mailSettings&amp;gt;       &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    &amp;lt;/system.net&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;Following code will drop an email in your folder&lt;/pre&gt;&lt;br /&gt;&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1: &lt;/span&gt;var smtpClient = &lt;span class="kwrd"&gt;new&lt;/span&gt; SmtpClient();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2: &lt;/span&gt;var message = &lt;span class="kwrd"&gt;new&lt;/span&gt; MailMessage(&lt;span class="str"&gt;"from@from.com"&lt;/span&gt;, &lt;span class="str"&gt;"to@to.com"&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3: &lt;/span&gt;message.Subject = &lt;span class="str"&gt;"This is the mail subject"&lt;/span&gt;;            &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4: &lt;/span&gt;message.Body = &lt;span class="str"&gt;"this is the mailm body"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   5:&lt;/span&gt; smtpClient.Send(message);         &lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;Double click on the file in your C:\testmails\ folder it will open up on outlook&lt;br&gt;as an email.&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-6071532549673413540?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/6071532549673413540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=6071532549673413540' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/6071532549673413540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/6071532549673413540'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/07/drop-emails-in-folder.html' title='Drop emails in a folder'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-8803029936838883404</id><published>2010-07-08T21:54:00.001+05:30</published><updated>2010-07-08T21:54:47.464+05:30</updated><title type='text'>Take asp.net web site offline App_Offline.htm</title><content type='html'>&lt;p&gt;Do not need to do any setting on ISS, instead just move in an HTMl file named   &lt;br /&gt;&lt;strong&gt;App_Offline.htm .&lt;/strong&gt; This will stop responding to any web request but as the response    &lt;br /&gt;this file passes until you remove it from the root or rename it.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-8803029936838883404?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/8803029936838883404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=8803029936838883404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8803029936838883404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8803029936838883404'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/07/take-aspnet-web-site-offline.html' title='Take asp.net web site offline App_Offline.htm'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-2374483745129645522</id><published>2010-06-29T13:13:00.004+05:30</published><updated>2010-06-29T13:28:32.394+05:30</updated><title type='text'>SQL DATE FORMAT</title><content type='html'>You might have comeacross, situations where the date doesn't show the way you want. Hope this table will help you to get sorted out this issue. &lt;br/&gt;&lt;br /&gt;&lt;table&gt;&lt;br /&gt;&lt;tbody&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td colspan="3"  style="color:gray;"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#ffffff;"&gt;DATE FORMATS&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Date Format&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Query&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:85%;"&gt; (current date: 12/30/2006) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Show&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;1 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 1) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;12/30/06 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;2 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 2) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;06.12.30 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;3 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 3) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;30/12/06 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;4 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 4) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;30.12.06 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;5 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 5) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;30-12-06 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;6 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 6) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;30 Dec 06 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;7 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 7) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Dec 30, 06 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;10 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 10) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;12-30-06 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;11 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 11) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;06/12/30 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;101 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 101) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;12/30/2006 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;102 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 102) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;2006.12.30 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;103 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 103) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;30/12/2006 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;104 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 104) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;30.12.2006 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;105 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 105) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;30-12-2006 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;106 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 106) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;30 Dec 2006 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;107 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 107) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Dec 30, 2006 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;110 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 110) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;12-30-2006 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td align="middle"&gt;&lt;span style="font-size:85%;"&gt;111 &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;select convert(varchar, getdate(), 111) &lt;/span&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;2006/12/30 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top" align="left"&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;br /&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-2374483745129645522?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/2374483745129645522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=2374483745129645522' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/2374483745129645522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/2374483745129645522'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/06/sql-date-format.html' title='SQL DATE FORMAT'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-8271272254897411971</id><published>2010-06-25T10:04:00.001+05:30</published><updated>2010-06-25T10:06:49.966+05:30</updated><title type='text'>SQL Split Function</title><content type='html'>I was just trying to do a split in a stored procedure, and found this&lt;br /&gt;link. This is really helpfull comparing with other resources available on the web.&lt;br /&gt;&lt;br /&gt;http://sqltutorials.blogspot.com/2007/09/sql-function-split.html&lt;br /&gt;&lt;br /&gt;Below is Split Function in SQL&lt;br /&gt;&lt;br /&gt;DECLARE @NextString NVARCHAR(40)&lt;br /&gt;DECLARE @Pos INT&lt;br /&gt;DECLARE @NextPos INT&lt;br /&gt;DECLARE @String NVARCHAR(40)&lt;br /&gt;DECLARE @Delimiter NVARCHAR(40)&lt;br /&gt;&lt;br /&gt;SET @String ='SQL,TUTORIALS'&lt;br /&gt;SET @Delimiter = ','&lt;br /&gt;SET @String = @String + @Delimiter&lt;br /&gt;SET @Pos = charindex(@Delimiter,@String)&lt;br /&gt;&lt;br /&gt;WHILE (@pos &lt;&gt; 0)&lt;br /&gt;BEGIN&lt;br /&gt;SET @NextString = substring(@String,1,@Pos - 1)&lt;br /&gt;SELECT @NextString -- Show Results&lt;br /&gt;SET @String = substring(@String,@pos+1,len(@String))&lt;br /&gt;SET @pos = charindex(@Delimiter,@String)&lt;br /&gt;END &lt;br /&gt;&lt;br /&gt;Result&lt;br /&gt;- SQL&lt;br /&gt;- TUTORIALS&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-8271272254897411971?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/8271272254897411971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=8271272254897411971' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8271272254897411971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8271272254897411971'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/06/sql-split-function.html' title='SQL Split Function'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-3878944019084506696</id><published>2010-05-23T19:43:00.001+05:30</published><updated>2010-05-23T19:43:41.185+05:30</updated><title type='text'>Dotnetnuke System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I got this error when I try to install Dotnetnuke 05.04.02 on my computer on Wndows 7 and IIS7. There was no proper solution for this on the web, but I just change the application pool identity to NetworkService and application worked as expected.&lt;/p&gt;  &lt;p&gt;Steps :   &lt;br /&gt;Go to IIS and select Application Pools.    &lt;br /&gt;Select the DNN web pool on right hand pane.    &lt;br /&gt;On Actions press Set Application Pool Default link.    &lt;br /&gt;Change the Identity under Process Model to NetworkService    &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_8EXfgyXF23E/S_k4BfSfYJI/AAAAAAAAEEk/ttavjNyI_cc/s1600-h/ApplicationPool%5B4%5D.gif"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="ApplicationPool" src="http://lh6.ggpht.com/_8EXfgyXF23E/S_k4EhlmHtI/AAAAAAAAEEo/KoQ-kInJZfY/ApplicationPool_thumb%5B2%5D.gif?imgmax=800" width="679" height="445" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-3878944019084506696?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/3878944019084506696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=3878944019084506696' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/3878944019084506696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/3878944019084506696'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/05/dotnetnuke-systemsecuritysecurityexcept.html' title='Dotnetnuke System.Security.SecurityException: Request for the permission of type &amp;#39;System.Web.AspNetHostingPermission'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_8EXfgyXF23E/S_k4EhlmHtI/AAAAAAAAEEo/KoQ-kInJZfY/s72-c/ApplicationPool_thumb%5B2%5D.gif?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-9014264458895306587</id><published>2010-05-19T12:57:00.001+05:30</published><updated>2010-05-19T13:00:42.910+05:30</updated><title type='text'>Use a Web Proxy for Cross-Domain XMLHttpRequest Calls</title><content type='html'>&lt;p&gt;   &lt;br /&gt;I had an issue when calling web service through AJAX from 3rd party URL.    &lt;br /&gt;&lt;a href="http://developer.yahoo.com/javascript/howto-proxy.html" target="_blank"&gt;Here&lt;/a&gt; is the solution     &lt;br /&gt;    &lt;br /&gt;&lt;a title="http://developer.yahoo.com/javascript/howto-proxy.html" href="http://developer.yahoo.com/javascript/howto-proxy.html"&gt;http://developer.yahoo.com/javascript/howto-proxy.html&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-9014264458895306587?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/9014264458895306587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=9014264458895306587' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/9014264458895306587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/9014264458895306587'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/05/use-web-proxy-for-cross-domain.html' title='Use a Web Proxy for Cross-Domain XMLHttpRequest Calls'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-5519648410976388175</id><published>2010-05-07T11:08:00.001+05:30</published><updated>2010-05-07T11:09:53.204+05:30</updated><title type='text'>Using JQuery on blogspot</title><content type='html'>&lt;p&gt;As I use JQuery these days, I just though how I can use JQuery on my blog.&lt;br&gt;I tried to do this and found It’s very easy to use it with blogger. Just a few steps &lt;br&gt;make this possible. You might be wondering where you can place the JQuery file in &lt;br&gt;blogger. Google has host these file on the following path “http://ajax.googleapis.com/ajax/libs/jquery/”. Just have to select the version you prefer to use.&lt;/p&gt; &lt;p&gt;Just see the following steps.&lt;br&gt;&lt;br&gt;&lt;strong&gt;Step 1:&lt;/strong&gt;&lt;br&gt;Add the following code between header tags of your blog’s HTML. &lt;br&gt;&lt;span style="color: blue"&gt;&lt;br&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;head&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;script &lt;/span&gt;&lt;span style="color: red"&gt;src&lt;/span&gt;&lt;span style="color: blue"&gt;='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js' &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;='text/javascript'/&amp;gt;&lt;br&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;head&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt; &lt;p&gt;Example:&lt;br&gt;&lt;a href="http://lh3.ggpht.com/_8EXfgyXF23E/S-OnLAPzvSI/AAAAAAAADtw/Ej8JtZNSYPs/s1600-h/1%5B6%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="1" border="0" alt="1" src="http://lh3.ggpht.com/_8EXfgyXF23E/S-OnM5DksCI/AAAAAAAADt4/fxcgf3vQBDQ/1_thumb%5B4%5D.png?imgmax=800" width="593" height="332"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Step 2:&lt;br&gt;&lt;/strong&gt;Add the functions in between header tags as follows,&lt;br&gt;&lt;span style="color: blue"&gt;&lt;br&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;head&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;script &lt;/span&gt;&lt;span style="color: red"&gt;src&lt;/span&gt;&lt;span style="color: blue"&gt;='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js' &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;='text/javascript'/&amp;gt;&lt;br&gt;&lt;span style="color: blue"&gt;&lt;br&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;script &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;="text/javascript"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function &lt;/span&gt;MouseOn() {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(document).ready(&lt;span style="color: blue"&gt;function&lt;/span&gt;() {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&lt;span style="color: #a31515"&gt;"img"&lt;/span&gt;).toggleClass(&lt;span style="color: #a31515"&gt;"newClass"&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green"&gt;//$("#testPara").append("Shiran the greatest" + count );&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;});&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;head&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;Example :&lt;br&gt;&lt;a href="http://lh3.ggpht.com/_8EXfgyXF23E/S-OnOPcD9OI/AAAAAAAADuA/AigDTRajmbY/s1600-h/22%5B7%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="22" border="0" alt="22" src="http://lh4.ggpht.com/_8EXfgyXF23E/S-OnP8Gp6zI/AAAAAAAADuI/Nht_ugspk7Q/22_thumb%5B5%5D.png?imgmax=800" width="594" height="276"&gt;&lt;/a&gt; &lt;/p&gt;&lt;pre class="code"&gt;&amp;nbsp;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Step 3: (Optional)&lt;br&gt;&lt;/strong&gt;If there are any CSS involved embed them also in between header tags as follows&lt;br&gt;&lt;span style="color: blue"&gt;&lt;br&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;head&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;script &lt;/span&gt;&lt;span style="color: red"&gt;src&lt;/span&gt;&lt;span style="color: blue"&gt;='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js' &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;='text/javascript'/&amp;gt;&lt;br&gt;&lt;span style="color: blue"&gt;&lt;br&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;script &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;="text/javascript"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function &lt;/span&gt;ChangeCSS() {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(document).ready(&lt;span style="color: blue"&gt;function&lt;/span&gt;() {&lt;br&gt;&lt;/span&gt;&lt;span style="color: green"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //here this will toggle CSS classes on an event&lt;br&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&lt;span style="color: #a31515"&gt;"img"&lt;/span&gt;).toggleClass(&lt;span style="color: #a31515"&gt;"newClass"&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green"&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;});&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;style &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;="text/css"&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;.toggler &lt;/span&gt;{&lt;span style="color: red"&gt;width&lt;/span&gt;: &lt;span style="color: blue"&gt;100px&lt;/span&gt;; &lt;span style="color: red"&gt;height&lt;/span&gt;: &lt;span style="color: blue"&gt;200px&lt;/span&gt;;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #a31515"&gt;.newClass &lt;/span&gt;{&lt;span style="color: red"&gt;width&lt;/span&gt;: &lt;span style="color: blue"&gt;500px&lt;/span&gt;; &lt;span style="color: red"&gt;height&lt;/span&gt;: &lt;span style="color: blue"&gt;866px&lt;/span&gt;;}&lt;br /&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: blue"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;head&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Need to call the above ChangeCSS() JS function where this need to be done.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Example:&lt;br&gt;this maight be in post or a HTML/JavaScript gadget&lt;br&gt;&lt;br&gt;&amp;lt;img class="toggler" src="&lt;a href="http://1.bp.blogspot.com/_8fX3E/S-L0RblzI/AAAADtQ/nB8kJYc/s200/108_f0.jpg&amp;quot;"&gt;http://1.bp.blogspot.com/_8fX3E/S-L0RblzI/AAAADtQ/nB8kJYc/s200/108_f0.jpg"&lt;/a&gt; onmouseover="ChangeCSS()"/&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Give your visitors a shock.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-5519648410976388175?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/5519648410976388175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=5519648410976388175' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/5519648410976388175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/5519648410976388175'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/05/using-jquery-on-blogspot.html' title='Using JQuery on blogspot'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_8EXfgyXF23E/S-OnM5DksCI/AAAAAAAADt4/fxcgf3vQBDQ/s72-c/1_thumb%5B4%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-2755774462507633010</id><published>2010-05-06T18:10:00.001+05:30</published><updated>2010-05-06T18:11:03.978+05:30</updated><title type='text'>Enable JQuery intellisense in VS 2008</title><content type='html'>&lt;p&gt;I just started to do some JQuery on one of my VS projects. I found that we can have intellisense on VS2008. To make this available I had to do some installations and follow few steps to get intellisense on VS2008, I hope these would helpful you as well in projects.&lt;/p&gt;  &lt;p&gt;Step 1:   &lt;br /&gt;Install VS 2008 SP1, you can get it &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&amp;amp;displaylang=en" target="_blank"&gt;here&lt;/a&gt;    &lt;br /&gt;    &lt;br /&gt;Step2:    &lt;br /&gt;Install VS 2008 Patch KB958502, you can get it &lt;a href="http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736" target="_blank"&gt;here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Step3:   &lt;br /&gt;Download JQuery js file and JQuery vsdoc.js, both these should be one version    &lt;br /&gt;Eg: jquery-1.4.1-vsdoc.js and jquery-1.4.1.js (version may be differ on the version you have downloaded).    &lt;br /&gt;Put both files in the same place in your project.    &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_8EXfgyXF23E/S-K4quU75jI/AAAAAAAADsY/R3sLL77Tf7E/s1600-h/JQuery%5B2%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="JQuery" border="0" alt="JQuery" src="http://lh4.ggpht.com/_8EXfgyXF23E/S-K4r3BG_GI/AAAAAAAADsc/O_NMTuDRznA/JQuery_thumb.png?imgmax=800" width="194" height="166" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;now you are ready to use. You will get intellisense and auto complete features on VS2009&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-2755774462507633010?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/2755774462507633010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=2755774462507633010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/2755774462507633010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/2755774462507633010'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/05/enable-jquery-intellisense-in-vs-2008.html' title='Enable JQuery intellisense in VS 2008'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_8EXfgyXF23E/S-K4r3BG_GI/AAAAAAAADsc/O_NMTuDRznA/s72-c/JQuery_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-9055356697336342024</id><published>2010-04-27T13:13:00.001+05:30</published><updated>2010-04-27T13:38:52.673+05:30</updated><title type='text'>using statement in C#</title><content type='html'>&lt;p&gt;This is a nice little statement which reduces our coding and minimises prone to errors.    &lt;br /&gt;There are many situations we have to Dispose the object we created. Example     &lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;string &lt;/span&gt;connString = &lt;span style="color: #a31515"&gt;&amp;quot;Data Source=localhost;Integrated Security=SSPI;Initial Catalog=MyDB;&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #2b91af"&gt;SqlConnection &lt;/span&gt;myConnect = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SqlConnection&lt;/span&gt;(connString);            &lt;br /&gt;&lt;span style="color: #2b91af"&gt;SqlCommand &lt;/span&gt;cmd = myConnect.CreateCommand();&lt;br /&gt;cmd.CommandText = &lt;span style="color: #a31515"&gt;&amp;quot;SELECT * FROM MyTable&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;myConnect.Open();&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #2b91af"&gt;SqlDataReader &lt;/span&gt;dr = cmd.ExecuteReader();&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue"&gt;while &lt;/span&gt;(dr.Read())&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;{0}\t{1}&amp;quot;&lt;/span&gt;, dr.GetString(0), dr.GetString(1));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;dr.Dispose();&lt;br /&gt;myConnect.Close();&lt;br /&gt;myConnect.Dispose();&lt;/pre&gt;&lt;br /&gt;Here on above example I just try to connect to a database and take out all records from MyTable. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have created a &lt;span style="color: #2b91af"&gt;SqlConnection &lt;/span&gt;object named myConnect&amp;#160; and a &lt;span style="color: #2b91af"&gt;SqlDataReader &lt;/span&gt;object named dr, at the very bottom of the code snippet I have disposed those two objects using Dispose() method. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What will happen if I forget to dispose these objects? memory issues, using statement is a remedy for this and its makes code more readable, robust and clean. I will recode the above code snippet with using “using ” statement. &lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;SqlConnection &lt;/span&gt;myConnect = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SqlConnection&lt;/span&gt;(connString))&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #2b91af"&gt;SqlCommand &lt;/span&gt;cmd = myConnect.CreateCommand();&lt;br /&gt;    cmd.CommandText = &lt;span style="color: #a31515"&gt;&amp;quot;SELECT * FROM MyTable&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;    myConnect.Open();&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;SqlDataReader &lt;/span&gt;dr = cmd.ExecuteReader())&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: blue"&gt;while &lt;/span&gt;(dr.Read())&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;{0}\t{1}&amp;quot;&lt;/span&gt;, dr.GetString(0), dr.GetString(1));&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;Don’t you feel more comfortable with using statement? Let me just go bit deep on using statement, how does this work? Actually when an using statement compiled, the CLR converts it to a try and Finally block. It does three things, get the resources (&lt;span style="color: #2b91af"&gt;SqlConnection &lt;/span&gt;), encloses in a try block and disposes in the Finally block. Hope you enjoyed …………….&lt;br /&gt;&lt;br /&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-9055356697336342024?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/9055356697336342024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=9055356697336342024' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/9055356697336342024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/9055356697336342024'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/04/using-statement-in-c.html' title='using statement in C#'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-8823438742071866219</id><published>2010-04-21T11:14:00.001+05:30</published><updated>2010-04-27T09:34:57.600+05:30</updated><title type='text'>Referring to another config file in web.config file</title><content type='html'>&lt;p&gt;Instead of having all connection string detail on web.config file , we can create a new configuration    &lt;br /&gt;whatEvernName.config eg(connectionString.config) and have all connection string details in this new .config file.&lt;/p&gt;  &lt;p&gt;Please go through the code below to understand this.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;web.config      &lt;br /&gt;&lt;/strong&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;connectionStrings &lt;/span&gt;&lt;span style="color: red"&gt;configSource&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;connectionString.config&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;/&amp;gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/span&gt;&lt;strong&gt;connectionString.config      &lt;br /&gt;&lt;/strong&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;connectionStrings&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&amp;#160; &lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;clear &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&amp;#160; &lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;add &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;myConnection&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;connectionString&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;myConnectionString&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;providerName&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;System.Data.SqlClient&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;/&amp;gt; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;connectionStrings&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;  &lt;p&gt;This is really nice feature when you have a lot of tags in your web.config file,    &lt;br /&gt;as it increases the readability. There is another cool feature which is very useful for     &lt;br /&gt;developers when it’s come to development or rather I would say debug the code.     &lt;br /&gt;Most of the times we have our connection string in one file and there is a high chance to forget     &lt;br /&gt;to change live connection string properties to test environment properties, I have made such a mistake and had to restore a latest database backup, but luckily there was not any data lost.&lt;/p&gt;  &lt;p&gt;This cool feature avoids taking place such a bad mistake. Try this it’s is really nice and you do not have to keep on changing your web.config’s conection string values. As in above code snippet you can have two config files as &lt;span style="color: blue"&gt;connectionString.debug.config and &lt;span style="color: blue"&gt;connectionString.releaase.config&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;VS IDE will take the valuse depending on what you have selected, debug or release. Isn’t it cool.    &lt;br /&gt;Enjoy…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-8823438742071866219?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/8823438742071866219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=8823438742071866219' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8823438742071866219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8823438742071866219'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/04/referring-to-another-config-file-in.html' title='Referring to another config file in web.config file'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-6028491272505160750</id><published>2010-04-20T17:09:00.001+05:30</published><updated>2010-04-20T17:16:34.334+05:30</updated><title type='text'>GridView column text wrap width</title><content type='html'>&lt;p&gt;We had a grid view and one of the column data was dynamically bound. Most of the time this grid goes out of the sreen area and makes user to scroll to right, because of this dynamically bounded column's text lenght. There were some solutions on the web but none of them working properly. Solution is, put the text inside a paragraph tag “&amp;lt;p&amp;gt; your text here&amp;lt;/p&amp;gt;” &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_8EXfgyXF23E/S82T-Ed_xGI/AAAAAAAAC6E/LSg7l2wCHZE/s1600-h/text-wrap%5B4%5D.gif"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="text-wrap" border="0" alt="text-wrap" src="http://lh4.ggpht.com/_8EXfgyXF23E/S82T-1-bg3I/AAAAAAAAC6I/FwtQ41QsWng/text-wrap_thumb%5B2%5D.gif?imgmax=800" width="607" height="224" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-6028491272505160750?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/6028491272505160750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=6028491272505160750' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/6028491272505160750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/6028491272505160750'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/04/gridview-column-text-wrap-width.html' title='GridView column text wrap width'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_8EXfgyXF23E/S82T-1-bg3I/AAAAAAAAC6I/FwtQ41QsWng/s72-c/text-wrap_thumb%5B2%5D.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-1961638357293550544</id><published>2010-04-09T05:46:00.003+05:30</published><updated>2010-04-09T06:33:31.567+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Navigation'/><category scheme='http://www.blogger.com/atom/ns#' term='Scott Guthie'/><category scheme='http://www.blogger.com/atom/ns#' term='Websites Navigation'/><category scheme='http://www.blogger.com/atom/ns#' term='Rules to Better Websites Navigation'/><title type='text'>Rules to Better Websites Navigation</title><content type='html'>&lt;font face="Arial"&gt;These rules I found while I am going through Scott Guthrie's web blog. It's captioned as &amp;quot;Adam Cogan's Rules for Better WebSites&amp;quot; and this was written in September 2003, pretty old but still apply.   &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterWebsitesNavigation.aspx#underline"&gt;http://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterWebsitesNavigation.aspx#underline&lt;/a&gt;    &lt;br /&gt;    &lt;br /&gt;Scott Guthie's web blog http://weblogs.asp.net/Scottgu/&lt;/font&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-1961638357293550544?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/1961638357293550544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=1961638357293550544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/1961638357293550544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/1961638357293550544'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/04/rules-to-better-websites-navigation.html' title='Rules to Better Websites Navigation'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-3020055679637157375</id><published>2010-02-10T22:52:00.002+05:30</published><updated>2010-02-10T22:59:11.853+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010 Beta 2'/><title type='text'>Visual Studio 2010 Beta 2</title><content type='html'>Hi All,&lt;br /&gt;This is what microsoft says, why don't you take this precious chance..........&lt;br /&gt;&lt;br /&gt;"Now you can with&lt;br /&gt;Visual Studio 2010 Beta 2 Jumpstart your next project with Visual Studio 2010 Beta 2. The "Go Live" license with this release means you can develop and deploy before the finished product hits the shelf."&lt;br /&gt;&lt;br /&gt;Here is the URL http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-3020055679637157375?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/3020055679637157375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=3020055679637157375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/3020055679637157375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/3020055679637157375'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2010/02/visual-studio-2010-beta-2.html' title='Visual Studio 2010 Beta 2'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-1273264439391893036</id><published>2009-10-29T17:25:00.002+05:30</published><updated>2009-10-29T17:50:25.871+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='XSD'/><category scheme='http://www.blogger.com/atom/ns#' term='dataset'/><title type='text'>Microsoft Visual Studio 2005 with Microsoft SQL Server 2008 Support</title><content type='html'>I had an issue connecting to sql server 2008 database&lt;br /&gt;in a VS 2005 application, I used .xsd (datase) to&lt;br /&gt;manipulate data. I got an error,&lt;br /&gt;&lt;br /&gt;I hope the fix would be helpfull to you as well, download and&lt;br /&gt;install, Studio 2005 Service Pack 1 Update for Microsoft SQL Server 2008 Support&lt;br /&gt;&lt;br /&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=e1109aef-1aa2-408d-aa0f-9df094f993bf&amp;displaylang=en&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-1273264439391893036?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/1273264439391893036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=1273264439391893036' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/1273264439391893036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/1273264439391893036'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/10/microsoft-visual-studio-2005-with.html' title='Microsoft Visual Studio 2005 with Microsoft SQL Server 2008 Support'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-6010494109527753113</id><published>2009-10-22T07:04:00.004+05:30</published><updated>2009-10-22T11:12:06.000+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='dataset'/><category scheme='http://www.blogger.com/atom/ns#' term='stoed procedure return value'/><category scheme='http://www.blogger.com/atom/ns#' term='dataset and return value'/><title type='text'>How do I get the return value and dataset when calling a stored procedure in a typed DataSet object?</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;There is no direct way to retrieve the returning value from a stored procedure in typed DataSet object. To accomplish this what you have to do is just add a new method in the partial class of the generated table adapter. Ill show how to do this step by step.&lt;/p&gt;&lt;p&gt;Consider the following stored procedure, which returns a dataset plus a return value. (not a complicated SP). In this case I just return 0 from the SP.&lt;/p&gt;&lt;p&gt;CREATE PROCEDURE [dbo].[GetUser]&lt;br /&gt;@EmailID VARCHAR (100)&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;SELECT&lt;br /&gt;[UserID],&lt;br /&gt;[FirstName],&lt;br /&gt;[LastName],&lt;br /&gt;[Phone]&lt;br /&gt;FROM&lt;br /&gt;[dbo].[User]&lt;br /&gt;WHERE&lt;br /&gt;[EmailID] = @EmailID &lt;/p&gt;&lt;p&gt;RETURN 0&lt;br /&gt;END&lt;/p&gt;&lt;p&gt;Now add the method following method in the partial class of the generated table adapter. In my case it's UserTableAdapter.&lt;/p&gt;&lt;pre class="csharpcode"&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; UserTableAdapter&lt;br /&gt; {&lt;br /&gt;     &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; GetReturnValue(&lt;span class="kwrd"&gt;int&lt;/span&gt; commandIndex)&lt;br /&gt;     {&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;this&lt;/span&gt;.CommandCollection[commandIndex].Parameters[0].Value;&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Ok, now you can retrieve the return value plus the dataset,&lt;/p&gt;&lt;div class="csharpcode"&gt;&lt;br /&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; DSTableAdapters.UserTableAdapter _userAdapter = &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; DSTableAdapters.UserTableAdapter Adapter{&lt;br /&gt;     get{&lt;br /&gt;         &lt;span class="kwrd"&gt;if&lt;/span&gt; (_userAdapter == &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;br /&gt;           _userAdapter = &lt;span class="kwrd"&gt;new&lt;/span&gt; DSTableAdapters.UserTableAdapter();&lt;br /&gt;               &lt;span class="kwrd"&gt;return&lt;/span&gt; _userAdapter;&lt;br /&gt;           }&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is the method that retrieve dataset and the get return value by calling the method (GetReturnValue(&lt;span class="kwrd"&gt;int&lt;/span&gt; commandIndex) ) we added in to generated partial class&lt;/p&gt;&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; GetUser(&lt;span class="kwrd"&gt;string&lt;/span&gt; emailid)&lt;br /&gt;{&lt;br /&gt;    &lt;span class="kwrd"&gt;int&lt;/span&gt; success ;&lt;br /&gt;    &lt;span class="kwrd"&gt;try&lt;br /&gt;&lt;/span&gt;    {     &lt;/pre&gt;&lt;pre&gt;        DS.UserDataTable userDataTable = Adapter.GetUser(emailid);&lt;br /&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (userDataTable.Rows.Count &amp;gt; 0)&lt;br /&gt;        {&lt;br /&gt;           &lt;span class="rem"&gt;//assingning to variables&lt;br /&gt;&lt;/span&gt;            FirstName = userDataTable.Rows[0][&lt;span class="str"&gt;"FirstName"&lt;/span&gt;].ToString();&lt;br /&gt;            LastName = userDataTable.Rows[0][&lt;span class="str"&gt;"LastName"&lt;/span&gt;].ToString();&lt;br /&gt;            success = &lt;span class="kwrd"&gt;int&lt;/span&gt;.Parse(Adapter.GetReturnValue(0).ToString());&lt;br /&gt;        }   &lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;catch&lt;/span&gt; (Exception ex)&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="rem"&gt;//write you exception handling&lt;br /&gt;&lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; success; &lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-6010494109527753113?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/6010494109527753113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=6010494109527753113' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/6010494109527753113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/6010494109527753113'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/10/how-do-i-get-return-value-and-dataset.html' title='How do I get the return value and dataset when calling a stored procedure in a typed DataSet object?'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-2959390217192696028</id><published>2009-10-14T15:59:00.002+05:30</published><updated>2009-10-14T16:09:48.870+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Limiting Textarea length'/><title type='text'>Limiting Textarea length</title><content type='html'>I just wrote a java script to limit the max length of a teaxtarea control.&lt;br /&gt;Here is the code snippet.&lt;br /&gt;&lt;br /&gt;Limiting Textarea length&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;'textarea name="txaDescription" onkeypress="return maxLength(this, 250);" textarea&gt; &lt;br /&gt;&lt;br /&gt;and the javascript &lt;br /&gt;&lt;br /&gt;function imposeMaxLength(Object, MaxLen)&lt;br /&gt;{&lt;br /&gt;    return (Object.value.length &lt;= MaxLen);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-2959390217192696028?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/2959390217192696028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=2959390217192696028' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/2959390217192696028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/2959390217192696028'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/10/limiting-textarea-length.html' title='Limiting Textarea length'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-3503406941580362325</id><published>2009-09-25T14:19:00.001+05:30</published><updated>2009-09-25T14:20:44.263+05:30</updated><title type='text'>Javascript optional parameters</title><content type='html'>&lt;script language="javascript"&gt;&lt;br /&gt;&lt;br /&gt;function OptionalParamTest (a , b)&lt;br /&gt;{ &lt;br /&gt; if (b == undefined)&lt;br /&gt; {&lt;br /&gt;  alert("Optional Parameter")&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function call()&lt;br /&gt;{&lt;br /&gt;  OptionalParamTest (5 );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-3503406941580362325?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/3503406941580362325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=3503406941580362325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/3503406941580362325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/3503406941580362325'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/09/javascript-optional-parameters.html' title='Javascript optional parameters'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-1237037452399479012</id><published>2009-09-09T21:42:00.002+05:30</published><updated>2009-09-09T21:46:17.879+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Numeric Only'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Numeric only , windows programing , C#.Net</title><content type='html'>If you want to restrict a text box, to enter only numeric values.&lt;br /&gt;Just do the following in the KeyPress event.     &lt;br /&gt;&lt;br /&gt;private void txtOpenCount_KeyPress(object sender, KeyPressEventArgs e)&lt;br /&gt;{&lt;br /&gt;  string str = "\b0123456789";&lt;br /&gt;  e.Handled = !(str.Contains(e.KeyChar.ToString()));&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-1237037452399479012?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/1237037452399479012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=1237037452399479012' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/1237037452399479012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/1237037452399479012'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/09/numeric-only-windows-programing-cnet.html' title='Numeric only , windows programing , C#.Net'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-5717089128318164942</id><published>2009-08-23T18:23:00.003+05:30</published><updated>2009-08-23T18:53:46.720+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# INPUT'/><category scheme='http://www.blogger.com/atom/ns#' term='input dialog box'/><category scheme='http://www.blogger.com/atom/ns#' term='DIALOG BOX'/><title type='text'>inputbox in C#</title><content type='html'>I had to do a windows program, which is not that familier to me with .Net technology as I am ASP.Net guy. But it was really interesting than I thought before start the developments. In my early carrier I have done lot of developments using VB6.0 and in present too.&lt;br /&gt;I wanted to add a input box in my new windows program which is in C#.Net, suddenly I realised that there is no input dialog box with C#.Net but I found a link to do a input dialog box, which was really helpfull. I think it would be really helpfull you guys as well.&lt;br /&gt;&lt;br /&gt;http://www.knowdotnet.com/articles/inputbox.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-5717089128318164942?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/5717089128318164942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=5717089128318164942' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/5717089128318164942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/5717089128318164942'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/08/inputbox-in-c.html' title='inputbox in C#'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-1434355221482884255</id><published>2009-08-12T16:22:00.002+05:30</published><updated>2009-08-12T17:50:32.074+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql charset'/><category scheme='http://www.blogger.com/atom/ns#' term='first letter'/><category scheme='http://www.blogger.com/atom/ns#' term='lile'/><category scheme='http://www.blogger.com/atom/ns#' term='not like'/><category scheme='http://www.blogger.com/atom/ns#' term='&apos;[]%&apos;'/><title type='text'>SQL LIKE THAN YOU LIKE</title><content type='html'>&lt;div&gt;   &lt;br /&gt;    &lt;div&gt;     &lt;br /&gt;      &lt;p&gt;Do not confuse with the title, let me explain what it is. Consider about the following table,&lt;a href="http://1.bp.blogspot.com/_8EXfgyXF23E/SoKxg6QFibI/AAAAAAAAACc/d0WFz-ga78Y/s1600-h/slectall.gif"&gt;&lt;img style="margin: 0px 10px 10px 0px; width: 370px; float: left; height: 126px; cursor: hand" id="BLOGGER_PHOTO_ID_5369048884729711026" border="0" alt="" src="http://1.bp.blogspot.com/_8EXfgyXF23E/SoKxg6QFibI/AAAAAAAAACc/d0WFz-ga78Y/s200/slectall.gif" /&gt;&lt;/a&gt; (Persons)        &lt;br /&gt;        &lt;br /&gt;&lt;/p&gt;      &lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;      &lt;p&gt;&lt;/p&gt;      &lt;br /&gt;      &lt;br /&gt;      &lt;p&gt;       &lt;br /&gt;One might need to get only the FirstName that starts with letter ‘W’        &lt;br /&gt;in this case we can write our query as follows        &lt;br /&gt;        &lt;br /&gt;&lt;span style="color: #408080"&gt;SELECT * FROM Persons WHERE FirstName LIKE 'W%'         &lt;br /&gt;          &lt;br /&gt;&lt;/span&gt;Result would be &lt;/p&gt;     &lt;a href="http://1.bp.blogspot.com/_8EXfgyXF23E/SoKx1G68D7I/AAAAAAAAACk/Hn0nMlYL5QY/s1600-h/like,first-letter,-sql-like.gif"&gt;&lt;img style="margin: 0px 10px 10px 0px; width: 302px; float: left; height: 50px; cursor: hand" id="BLOGGER_PHOTO_ID_5369049231728054194" border="0" alt="" src="http://1.bp.blogspot.com/_8EXfgyXF23E/SoKx1G68D7I/AAAAAAAAACk/Hn0nMlYL5QY/s200/like,first-letter,-sql-like.gif" /&gt;&lt;/a&gt;      &lt;br /&gt;      &lt;br /&gt;      &lt;p&gt;&lt;/p&gt;      &lt;br /&gt;      &lt;br /&gt;      &lt;p&gt;OK cool , what if you need to get all the records that FirstName starts       &lt;br /&gt;with letter ‘W’ and letter ‘R’, in this case I am sure most of developes        &lt;br /&gt;query would be as follows.        &lt;br /&gt;        &lt;br /&gt;&lt;span style="color: #408080"&gt;SELECT * FROM Persons WHERE FirstName LIKE 'W%' OR FirstName LIKE 'R%' &lt;/span&gt;&lt;/p&gt;     &lt;a href="http://4.bp.blogspot.com/_8EXfgyXF23E/SoKycGh_mSI/AAAAAAAAACs/3p36VWpCLJs/s1600-h/like-,-or-,sql-wildcard.gif"&gt;&lt;img style="margin: 0px 10px 10px 0px; width: 304px; float: left; height: 78px; cursor: hand" id="BLOGGER_PHOTO_ID_5369049901638326562" border="0" alt="" src="http://4.bp.blogspot.com/_8EXfgyXF23E/SoKycGh_mSI/AAAAAAAAACs/3p36VWpCLJs/s200/like-,-or-,sql-wildcard.gif" /&gt;&lt;/a&gt;      &lt;br /&gt;      &lt;p&gt;&lt;/p&gt;      &lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;      &lt;p&gt;       &lt;br /&gt;        &lt;br /&gt;Fine, you got the result what you expected but there is another way to do this        &lt;br /&gt;without using OR FirstName LIKE ‘R%’        &lt;br /&gt;        &lt;br /&gt;&lt;span style="color: #408080"&gt;SELECT * FROM Persons WHERE FirstName LIKE '[WR]%'         &lt;br /&gt;&lt;/span&gt;        &lt;br /&gt;Don’t you think this is better? Keep in mind you can use this not only for the first letter        &lt;br /&gt;you can use this for last letter even you can use with negation ( LIKE ‘[^WR]%’)&lt;/p&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-1434355221482884255?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/1434355221482884255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=1434355221482884255' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/1434355221482884255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/1434355221482884255'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/08/sql-like-than-you-like.html' title='SQL LIKE THAN YOU LIKE'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8EXfgyXF23E/SoKxg6QFibI/AAAAAAAAACc/d0WFz-ga78Y/s72-c/slectall.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-3955213570787543165</id><published>2009-08-11T14:27:00.001+05:30</published><updated>2009-08-11T16:03:27.872+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL TOP PERCENT'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL  PERCENT'/><category scheme='http://www.blogger.com/atom/ns#' term='ORDER BY'/><category scheme='http://www.blogger.com/atom/ns#' term='sql 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='PERCENT'/><title type='text'>Get percentage of records from a table</title><content type='html'>&lt;p&gt;Have you ever come across a situation where you need to get top&amp;#160; 25%    &lt;br /&gt;records from a table. Here is the SQL that returns first 25% of records from a table.&lt;/p&gt;  &lt;p&gt;&lt;font color="#408080" size="3" face="Vrinda"&gt;SELECT TOP 25 PERCENT *&amp;#160; &lt;br /&gt;FROM dbo.yourtable&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;This will return what you want, the 25% of records from the table. What if you want the second 25% of records.&lt;/p&gt;  &lt;p&gt;&lt;font color="#408080" size="3" face="Vrinda"&gt;SELECT TOP 50 PERCENT *      &lt;br /&gt;FROM ( SELECT TOP 50 PERCENT *&amp;#160; &lt;br /&gt;FROM dbo.yourtable) results ORDER BY 1 DESC&lt;/font&gt;&lt;/p&gt;  &lt;br /&gt;On the above query by descending the records by first column, assuming that it is the primerykey or the records we need to filter by, you will get the top&amp;#160; 25% which is the second 25% of the records.   &lt;p&gt;Think how to get the third and the last 25% records leisurely.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-3955213570787543165?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/3955213570787543165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=3955213570787543165' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/3955213570787543165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/3955213570787543165'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/08/get-percentage-of-records-from-table.html' title='Get percentage of records from a table'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-962538260884533053</id><published>2009-08-06T17:14:00.003+05:30</published><updated>2009-08-06T22:26:44.812+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ConnectionStringBuilders'/><category scheme='http://www.blogger.com/atom/ns#' term='C# ConnectionStringBuilders'/><title type='text'>ConnectionStringBuilders</title><content type='html'>&lt;p&gt;&lt;br /&gt;Connection string is a string variable which include many properties and values (InitialCatelog, uid, pwd , Data Source) needs to connect to a database.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:teal;"&gt;SqlConnection &lt;/span&gt;cn = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:teal;"&gt;SqlConnection&lt;/span&gt;();&lt;br /&gt;cn.ConnectionString =&lt;span style="color:maroon;"&gt;"uid=sa;pwd=Initial Catalog=ADO; Data Source=(local); ConnectTimeout = 30"&lt;/span&gt;;&lt;br /&gt;cn.Open();&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Creating connection string is bit tedious as it’s a string and could be error prone.&lt;br /&gt;&lt;br /&gt;ADO.Net providers support connection string builder objects which allow you to create connection string , and  establish the name/value pairs using strongly typed properties.&lt;br /&gt;&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:teal;"&gt;SqlConnectionStringBuilder &lt;/span&gt;cnStrBuilder = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:teal;"&gt;SqlConnectionStringBuilder&lt;/span&gt;();&lt;br /&gt;cnStrBuilder.UserID = &lt;span style="color:maroon;"&gt;"sa"&lt;/span&gt;;&lt;br /&gt;cnStrBuilder.Password = &lt;span style="color:maroon;"&gt;""&lt;/span&gt;;&lt;br /&gt;cnStrBuilder.InitialCatalog = &lt;span style="color:maroon;"&gt;"ADO"&lt;/span&gt;;&lt;br /&gt;cnStrBuilder.DataSource = &lt;span style="color:maroon;"&gt;"(local)"&lt;/span&gt;;&lt;br /&gt;cnStrBuilder.ConnectTimeout = 30;&lt;br /&gt;&lt;span style="color:teal;"&gt;SqlConnection &lt;/span&gt;cn = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:teal;"&gt;SqlConnection&lt;/span&gt;();&lt;br /&gt;cn.ConnectionString = cnStrBuilder.ConnectionString;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here on above example , creates a SqlConnectionStringBuilder  variable and passing values for&lt;br /&gt;ConnectionStringBuilder properties and then the ConnectionStringBuilder’s ConnectionString  value been assigned to cn.ConnectionString instead directly passing ConnectionString string&lt;br /&gt;as follows.&lt;br /&gt;&lt;/p&gt;&lt;pre class="code"&gt;cn.ConnectionString =&lt;span style="color:maroon;"&gt;"uid=sa;pwd=Initial Catalog=ADO; Data Source=(local); "&lt;/span&gt;;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-962538260884533053?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/962538260884533053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=962538260884533053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/962538260884533053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/962538260884533053'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/08/connectionstringbuilders_06.html' title='ConnectionStringBuilders'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-6768579679245373325</id><published>2009-08-04T12:17:00.003+05:30</published><updated>2009-08-14T06:50:20.487+05:30</updated><title type='text'>C# File.WriteAllText, File.ReadAllText &amp; File.WriteAllLines</title><content type='html'>&lt;div style="margin: 0px; padding: 0px; display: inline; float: none;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:7598acb1-10a4-4cb5-9142-5b1ca7ecb02b" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/C%23+File.WriteAllText" rel="tag"&gt;C# File.WriteAllText&lt;/a&gt;,&lt;a href="http://technorati.com/tags/C%23+File.ReadAllText" rel="tag"&gt;C# File.ReadAllText&lt;/a&gt;,&lt;a href="http://technorati.com/tags/C%23+File.WriteAllLines" rel="tag"&gt;C# File.WriteAllLines&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;  &lt;br /&gt;Most of the times as developers we have to work with text files, as it’s a very simple way to store some data. There are very valuable methods available in File class that we are not using most often. &lt;/p&gt;  &lt;p&gt;Look at the following example which writes a formatted string to a text file with new lines.   &lt;br /&gt;This is more readable than WriteLine() method. If you use WriteLine() Method then you will have to write line by line most probably you may have to use a loop. &lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;protected void &lt;/span&gt;btnTextManipulation_Click(objectsender, &lt;span style="color: rgb(43, 145, 175);"&gt;EventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;       &lt;span style="color:green;"&gt;//gets the file path&lt;br /&gt;      &lt;/span&gt;stringfilePath = Server.MapPath(&lt;span style="color: rgb(163, 21, 21);"&gt;"Files/test.txt"&lt;/span&gt;);&lt;br /&gt;       StringBuilder content = new StringBuilder();&lt;br /&gt;&lt;br /&gt;       &lt;span style="color:green;"&gt;//note the end of this line i.e \r\n this says enter a new line&lt;br /&gt;      &lt;/span&gt;content.Append(&lt;span style="color: rgb(163, 21, 21);"&gt;"This is the first line. \r\n"&lt;/span&gt;);&lt;br /&gt;       content.Append(&lt;span style="color: rgb(163, 21, 21);"&gt;"This is the secont line. \r\n"&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;       &lt;span style="color:green;"&gt;//Environment.NewLine this says enter a new line too&lt;br /&gt;      &lt;/span&gt;content.Append(&lt;span style="color: rgb(163, 21, 21);"&gt;"This is the last line."&lt;/span&gt;+ &lt;span style="color: rgb(43, 145, 175);"&gt;Environment&lt;/span&gt;.NewLine);&lt;br /&gt;     &lt;br /&gt;       &lt;span style="color:green;"&gt;//Writes to test.txt&lt;br /&gt;      &lt;/span&gt;WriteText(filePath, content.ToString());&lt;br /&gt;&lt;br /&gt;       &lt;span style="color:green;"&gt;//reads from test.txt and asssing to a variable&lt;br /&gt;      &lt;/span&gt;stringreadTxt = ReadText(filePath);&lt;br /&gt;&lt;br /&gt;       filePath = Server.MapPath(&lt;span style="color: rgb(163, 21, 21);"&gt;"Files/test2.txt"&lt;/span&gt;);&lt;br /&gt;       &lt;span style="color:green;"&gt;//Writes to test2.txt&lt;br /&gt;      &lt;/span&gt;WriteText(filePath, readTxt);&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;&lt;span style="color:blue;"&gt;public &lt;/span&gt;void WriteText(stringpath, stringcontent)&lt;br /&gt;{&lt;br /&gt;       &lt;span style="color:green;"&gt;//this file method writes all test you pass&lt;br /&gt;      &lt;/span&gt;File.WriteAllText(path, content);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;public &lt;/span&gt;string ReadText(stringpath)&lt;br /&gt;{&lt;br /&gt;       &lt;span style="color:green;"&gt;//this file method reads whole content of the text file.&lt;br /&gt;      &lt;/span&gt;returnFile.ReadAllText(path);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I will show another example which writes array items in new lines.In the following example WriteAllines() method writesall the items in an array as a new line. With using WriteAllLines() method you can avoid a loop, hich needs to loop through the array and WriteLine to the text file.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;protected void &lt;/span&gt;btnTextManipulation_Click1(&lt;span style="color:blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color: rgb(43, 145, 175);"&gt;EventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color:green;"&gt;//get the file path&lt;br /&gt;   &lt;/span&gt;&lt;span style="color:blue;"&gt;string &lt;/span&gt;filePath = Server.MapPath(&lt;span style="color: rgb(163, 21, 21);"&gt;"Files/test.txt"&lt;/span&gt;);&lt;br /&gt;   &lt;span style="color:green;"&gt;//declare and assign a string array&lt;br /&gt;       &lt;/span&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;[] content = { &lt;span style="color: rgb(163, 21, 21);"&gt;"This is the first line."&lt;/span&gt;, &lt;span style="color: rgb(163, 21, 21);"&gt;"his is the secont line."&lt;/span&gt;, &lt;span style="color: rgb(163, 21, 21);"&gt;"This is the last line." &lt;/span&gt;};&lt;br /&gt;       WriteArrayText(filePath, content);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;public void &lt;/span&gt;WriteArrayText(&lt;span style="color:blue;"&gt;string &lt;/span&gt;path, &lt;span style="color:blue;"&gt;string&lt;/span&gt;[] content)&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color:green;"&gt;//this file method writes all test you pass&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;File&lt;/span&gt;.WriteAllLines(path, content);&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-6768579679245373325?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/6768579679245373325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=6768579679245373325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/6768579679245373325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/6768579679245373325'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/08/writealltext-readalltext-writealllines.html' title='C# File.WriteAllText, File.ReadAllText &amp;amp; File.WriteAllLines'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-4133650875767491784</id><published>2009-07-31T14:05:00.007+05:30</published><updated>2009-07-31T16:24:39.139+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web service'/><category scheme='http://www.blogger.com/atom/ns#' term='Enable session state on a Web Methods'/><title type='text'>Enable session state on a Web Methods, Web service</title><content type='html'>&lt;p&gt;By default each web method session state is disabled.&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Declare and assign a session variable in Global.asax Session_Start.&lt;br /&gt;&lt;span style="color:blue;"&gt;&lt;br /&gt;void &lt;/span&gt;Session_Start(&lt;span style="color:blue;"&gt;object&lt;/span&gt;sender, &lt;span style="color:#2b91af;"&gt;EventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;Session["Overhead"] = 3;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Access this session variable (Session["Overhead"] ) in Add Web Method.&lt;br /&gt;&lt;/p&gt;&lt;pre class="code"&gt;[&lt;span style="color:#2b91af;"&gt;WebMethod&lt;/span&gt;(Description = &lt;span style="color:#a31515;"&gt;"adds x , y and Overhead session"&lt;/span&gt;)]&lt;br /&gt;&lt;span style="color:blue;"&gt;public int &lt;/span&gt;Add(&lt;span style="color:blue;"&gt;int &lt;/span&gt;x, &lt;span style="color:blue;"&gt;int &lt;/span&gt;y)&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color:blue;"&gt;return &lt;/span&gt;(x + y) + (&lt;span style="color:blue;"&gt;int&lt;/span&gt;)Session[&lt;span style="color:#a31515;"&gt;"Overhead"&lt;/span&gt;] ;&lt;br /&gt;}&lt;/pre&gt;&lt;p&gt;This will not work and throws an error. To avoid this needs to enable session state in each web metods.&lt;br /&gt;&lt;br /&gt;Example:&lt;/p&gt;&lt;p&gt;[&lt;span style="color:#2b91af;"&gt;WebMethod&lt;/span&gt;(EnableSession = &lt;span style="color:blue;"&gt;true&lt;/span&gt;, Description = &lt;span style="color:#a31515;"&gt;"adds x , y and Overhead session"&lt;/span&gt;)]&lt;br /&gt;&lt;span style="color:blue;"&gt;public int &lt;/span&gt;Add(&lt;span style="color:blue;"&gt;int &lt;/span&gt;x, &lt;span style="color:blue;"&gt;int &lt;/span&gt;y)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt;(x + y) + (&lt;span style="color:blue;"&gt;int&lt;/span&gt;)Session[&lt;span style="color:#a31515;"&gt;"Overhead"&lt;/span&gt;] ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;In this above example in the [WebMethod] attribute &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;EnableSession&lt;/span&gt;&lt;/strong&gt; property has explicitily set to true. Now the Add web method is retrieving Session[&lt;span style="color:#a31515;"&gt;"Overhead"&lt;/span&gt;] variable’s value. All you have to do is just enable the session in [WebMethod] attribute.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-4133650875767491784?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/4133650875767491784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=4133650875767491784' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/4133650875767491784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/4133650875767491784'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/07/enable-session-state-on-web-method-web.html' title='Enable session state on a Web Methods, Web service'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-951649483453288071</id><published>2009-07-30T18:32:00.004+05:30</published><updated>2009-07-31T16:26:21.644+05:30</updated><title type='text'>WebService Method Overloading</title><content type='html'>&lt;h4&gt;Thursday, July 30, 2009&lt;/h4&gt;&lt;p&gt;&lt;a name="5374935126264500497"&gt;&lt;/a&gt;&lt;/p&gt;&lt;h5&gt;&lt;a href="http://shirans.blogspot.com/2009/07/webservice-method-overload.html"&gt;WebService Method Overload&lt;/a&gt;ing&lt;/h5&gt;&lt;p&gt;&lt;strong&gt;First of all what is method overloading ?&lt;/strong&gt;&lt;br /&gt;Method means having more than one method with the same name but different signature is the simple definition.&lt;br /&gt;Example: &lt;/p&gt;&lt;pre&gt;private int Add(int x, int y)&lt;br /&gt;{&lt;br /&gt;    return x + y;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private int Add(int x)&lt;br /&gt;{&lt;br /&gt;    return x + 3;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private float Add(float x, float y)&lt;br /&gt;{&lt;br /&gt;    return x + y;&lt;br /&gt;}&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;&lt;br /&gt;Above three methods have the same name but different signature.&lt;br /&gt;The following table shows the signature difference among Add methods.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;Though method overloading allowed in .Net, it's not allowed in web services as to comply with a rule (WSI BP 1.1 is that each method within a WSDL document must be unique), This clearly emphasis on method overloading. But by using [WebMethod] attribute we can use method overloading. With [WebMethod] pass the MessageName then web service uniquely identifies the overloaded methods.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;[WebMethod(Description = &lt;span style="color:#a31515;"&gt;"Adds two integers."&lt;/span&gt;,MessageName = &lt;span style="color:#a31515;"&gt;"AddInts"&lt;/span&gt;)]&lt;br /&gt;&lt;span style="color:blue;"&gt;private int &lt;/span&gt;Add(&lt;span style="color:blue;"&gt;int &lt;/span&gt;x, &lt;span style="color:blue;"&gt;int &lt;/span&gt;y)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:blue;"&gt;return &lt;/span&gt;x + y;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[WebMethod(Description = &lt;span style="color:#a31515;"&gt;"Adds 3 on an int value."&lt;/span&gt;,MessageName &lt;span style="color:#a31515;"&gt;"AddThree"&lt;/span&gt;)]&lt;br /&gt;&lt;span style="color:blue;"&gt;private int &lt;/span&gt;Add(&lt;span style="color:blue;"&gt;int &lt;/span&gt;x)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:blue;"&gt;return &lt;/span&gt;x + 3;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[WebMethod(Description = &lt;span style="color:#a31515;"&gt;"Adds two floats."&lt;/span&gt;, MessageName = &lt;span style="color:#a31515;"&gt;"AddFloats"&lt;/span&gt;)]&lt;br /&gt;&lt;span style="color:blue;"&gt;private float &lt;/span&gt;Add(&lt;span style="color:blue;"&gt;float &lt;/span&gt;x, &lt;span style="color:blue;"&gt;float &lt;/span&gt;y)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:blue;"&gt;return &lt;/span&gt;x + y;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;Here on above three Add methods have unique MessageName as to allow method overloading in web services&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-951649483453288071?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/951649483453288071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=951649483453288071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/951649483453288071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/951649483453288071'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/07/webservice-method-overload_30.html' title='WebService Method Overloading'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-856541999889558488</id><published>2009-07-28T16:15:00.013+05:30</published><updated>2009-07-29T10:54:38.449+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='named c#'/><category scheme='http://www.blogger.com/atom/ns#' term='optional arguments c#'/><category scheme='http://www.blogger.com/atom/ns#' term='vs2010'/><category scheme='http://www.blogger.com/atom/ns#' term='C# 4.0 optional parameters'/><title type='text'>VS2010 Beta  C# 4.0 Optional parameters, named arguments     A feature I was waiting for..</title><content type='html'>I was a VB 6.0 developer and I still doing some vb6.0 coding. I often use optional arguments(parameters) with vb6.0, which makes my life easy most of the times. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is an optional argument?&lt;/strong&gt;&lt;br /&gt;Arguments must be provided when calling a method if it is not an optional parameter, but can omit arguments for optional parameters.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;VB6.0&lt;br /&gt;&lt;br /&gt;Public Function PurchaseOrder(ByVal vPurOrdNo As String, Optional vNotes As Variant) &lt;br /&gt;''Coding....&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;on the above example PurchaseOrder function can be called in both ways as follows,&lt;br /&gt;&lt;br /&gt;call PurchaseOrder("2010", "passing value to optional argument")&lt;br /&gt;or&lt;br /&gt;call PurchaseOrder("2010")&lt;br /&gt;&lt;br /&gt;I was wondering why Microsoft dosn't introduce this feture in visual c# as it's provide such a richness for the language. I heard a good news, .Net 4.0 framework has this feture with named arguments.&lt;br /&gt;&lt;br /&gt;* Each optional parameter has a default value as part of its definition&lt;br /&gt;* If argument not passed for optional parameter then the default value will be used.&lt;br /&gt;* Optional parameters must be declared after all the normal parameters (most right side)&lt;br /&gt;&lt;br /&gt;Here is the above example PurchaseOrder method is C#&lt;br /&gt;&lt;br /&gt;public class OptionalArgumentExample&lt;br /&gt;{&lt;br /&gt;    static void Main(string[] args)&lt;br /&gt;    {&lt;br /&gt;          // Instance anExample does not send an argument for the constructor's&lt;br /&gt;          // optional parameter.&lt;br /&gt;          &lt;br /&gt;          PurchaseOrder("2010", "passing value to optional argument");          &lt;br /&gt;          PurchaseOrder(("2010");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   // optional parameters needs to be defined with default values. in this&lt;br /&gt;   // example "notes" paramete has a default value, so the here the "notes" &lt;br /&gt;   //parametes is optional.&lt;br /&gt;   public void PurchaseOrder(string purordno, string notes= "default string")&lt;br /&gt;   {&lt;br /&gt;       //coding here..&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is a named argument?&lt;/strong&gt;&lt;br /&gt;Named arguments allows you to pass an argument for a parameter with the parameter's name rather than with the parameter's position in the parameter list.&lt;br /&gt;Example: &lt;br /&gt;C# .Net4.0&lt;br /&gt;public class NameArgumentExample&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt;    static void Main(string[] args)&lt;br /&gt;    {&lt;br /&gt;        // Calling normal way&lt;br /&gt;        Console.WriteLine(CalculateInterest(5000, 10));&lt;br /&gt;&lt;br /&gt;        // passing with named arguments any order&lt;br /&gt;        Console.WriteLine(CalculateInterest(capitol: 5000, interestRate: 10));&lt;br /&gt;        Console.WriteLine(CalculateInterest(interestRate: 10, capitol: 5000));&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    static int CalculateInterest(int capitol, int interestRate)&lt;br /&gt;    {&lt;br /&gt;        return (( capitol / 100) * interestRate );&lt;br /&gt;    } &lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-856541999889558488?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/856541999889558488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=856541999889558488' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/856541999889558488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/856541999889558488'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/07/feature-i-was-waiting-for.html' title='VS2010 Beta  C# 4.0 Optional parameters, named arguments     A feature I was waiting for..'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-668495076926409189</id><published>2009-07-20T23:21:00.000+05:30</published><updated>2009-07-20T23:38:05.377+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Radio Button'/><category scheme='http://www.blogger.com/atom/ns#' term='check box'/><category scheme='http://www.blogger.com/atom/ns#' term='rare validation'/><title type='text'>Rare validation</title><content type='html'>It's very rare get a chance to validate a check box, I got it today. VS doesn't have a &lt;br /&gt;validation control to achieve this but www.asp.net has recommended a validation &lt;br /&gt;control i.e CheckValidator which is a .dll (AT.Web.UI.Validators.dll&lt;br /&gt;) and can be added to the tool panel. I added this to my validation controls section .&lt;br /&gt;Can be used as normal validation control to validate checkboxes and radio boxes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;"asp:checkbox ID="chkAgreement" runat="server" Text="I have read the agreement" /"&gt;&lt;br /&gt;&lt;"asp:Button ID="btnSubmit" runat="server" Style="z-index: 100; left: 129px; position: absolute; top: 77px" Text="Submit" /"&gt;&lt;br /&gt;&lt;br /&gt;&lt;"at:CheckValidator ID="_checkValidator" runat="server" ControlToValidate="chkAgreement" Text="Please accept the agreement" style="z-index: 102; left: 15px; position: absolute; top: 47px""&gt;&lt;br /&gt;&lt;"/at:CheckValidator"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-668495076926409189?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/668495076926409189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=668495076926409189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/668495076926409189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/668495076926409189'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/07/rare-validation.html' title='Rare validation'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-6903878574333678504</id><published>2009-07-20T18:25:00.000+05:30</published><updated>2009-07-20T22:19:26.517+05:30</updated><title type='text'>A personal belief</title><content type='html'>I personally believe as a Sri Lankan, Mr Bandaranayake is the bad ever governor&lt;br /&gt;in Sri Lanka. I personally  believe we are not yet independent though Mr. Bandaranayake &lt;br /&gt;spelled it several times. As declaring Sinhalese as the official language he created a gap between poor and rich, conflict between Tamils and Sinhalese and a opportunity to learn English which could have bring most success to our country,&lt;br /&gt;&lt;br /&gt;Watch this video and feel free to comment my personal vision.&lt;br /&gt;&lt;br /&gt;http://www.youtube.com/watch?v=rbL5E5naR6s&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-6903878574333678504?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/6903878574333678504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=6903878574333678504' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/6903878574333678504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/6903878574333678504'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/07/my-personal-belief.html' title='A personal belief'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-8216387863671705555</id><published>2009-07-16T14:06:00.001+05:30</published><updated>2009-07-16T14:13:28.815+05:30</updated><title type='text'>Session variable lifetime</title><content type='html'>&lt;h5&gt;&amp;#160;&lt;/h5&gt;  &lt;p&gt;Before I talk about session variable's life time, Ill just brief why a session variable comes in to play with a web application.    &lt;br /&gt;    &lt;br /&gt;A session is a mechanism to maintain state on a web application, as HTTP protocol is a stateless protocol. What does it means by stateless? this protocol (HTTP) serves as the request comes and destroys all the data (information) on a request. Pages are destroyed and recreated with each round trip to server. Session variables comes in to play when there is a requirement to maintain the state of a web application. Do not misunderstand that session is not the only mechanism to available to maintain state of a web application. Ok, will get back to the topic.     &lt;br /&gt;    &lt;br /&gt;On an ASP.Net application session variable's expiry time decides the life time of a Session     &lt;br /&gt;set in the web.config configuration section under     &lt;br /&gt;Example:    &lt;br /&gt;    &lt;br /&gt;&amp;lt; sessionState mode=&lt;span class="str"&gt;&amp;quot;InProc&amp;quot;&lt;/span&gt;&amp;#160; &lt;strong&gt;timeout=&lt;span class="str"&gt;&amp;quot;20&amp;quot;&lt;/span&gt;&lt;/strong&gt; &amp;gt;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;In the above example the &lt;font color="#ff0000" size="3"&gt;&lt;strong&gt;timeout = &amp;quot;20&amp;quot;&lt;/strong&gt;&lt;/font&gt; sets the&lt;br /&gt;expiry time of session variables to 20 minutes.&lt;br /&gt;&lt;/pre&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-8216387863671705555?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/8216387863671705555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=8216387863671705555' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8216387863671705555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8216387863671705555'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/07/session-variable-lifetime_16.html' title='Session variable lifetime'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-905539106018132588</id><published>2009-07-14T17:31:00.000+05:30</published><updated>2009-07-15T05:09:10.914+05:30</updated><title type='text'>A tip to avoid SQL injection</title><content type='html'>&lt;pre&gt;System.Data.SqlClient.SqlCommand cmd = &lt;span family="Microsoft Sans Serif"  style="color:blue;"&gt;new&lt;/span&gt; System.Data.SqlClient.SqlCommand(&lt;br /&gt;"select * from Orders where OrderID= '" + passOrderID + "'";&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:arial;"&gt;An user can pass anything to passOrderID , this leads a hacker to easily replace&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;string with something malicious. As shown in the above bad example do not build&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;dynamic strings, instead use parameters. Anything passed to a parameter considered&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;as field data and not as part of SQL statement, This avoids above malicious scenario.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Following code snippet demos a parametrized querying steps,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span family="Microsoft Sans Serif"  style="color:green;"&gt;                      &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span family="Microsoft Sans Serif"  style="color:green;"&gt;//define SQLCommand object&lt;/span&gt;&lt;br /&gt;System.Data.SqlClient.SqlCommand cmd = &lt;span family="Microsoft Sans Serif"  style="color:blue;"&gt;new&lt;/span&gt; System.Data.SqlClient.SqlCommand(&lt;br /&gt;"select * from Orders where OrderID= &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;@OrderID&lt;/span&gt;", conn);&lt;br /&gt;&lt;br /&gt;&lt;span family="Microsoft Sans Serif"  style="color:green;"&gt;//define parameters used in SQLCommand object&lt;/span&gt;&lt;br /&gt;SqlParameter para  = &lt;span family="Microsoft Sans Serif"  style="color:blue;"&gt;new&lt;/span&gt; SqlParameter();&lt;br /&gt;para.ParameterName = "&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;@OrderID"&lt;/span&gt;;&lt;br /&gt;para.Value = &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;passOrderID&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span family="Microsoft Sans Serif"  style="color:green;"&gt;// add parameter to &lt;/span&gt;&lt;span&gt;&lt;span family="Microsoft Sans Serif"  style="color:green;"&gt;SQLCommand &lt;/span&gt;&lt;/span&gt;&lt;span family="Microsoft Sans Serif"  style="color:green;"&gt;object&lt;/span&gt;&lt;br /&gt;cmd.Parameters.Add(para);&lt;br /&gt;&lt;br /&gt;or in one line&lt;br /&gt;&lt;br /&gt;cmd.Parameters.Add(new SqlParameter("&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;@OrderID",&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;passOrderID&lt;/span&gt;));&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;This makes the application more secure.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-905539106018132588?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/905539106018132588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=905539106018132588' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/905539106018132588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/905539106018132588'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/07/tip-to-avoid-sql-injection.html' title='A tip to avoid SQL injection'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-131559137914395908</id><published>2009-07-13T06:42:00.000+05:30</published><updated>2009-07-13T09:33:54.217+05:30</updated><title type='text'>Early and Late Binding</title><content type='html'>Declaring an variable with specific object type called Early Binding.&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;pre class="libCScode" style="" id="ctl00_MTContentSelector1_mainContentContainer_ctl02VisualBasic" space="preserve"&gt;&lt;span style="color:green;"&gt;'  Create a variable to hold a new object of type File Stream.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;Dim&lt;/span&gt; fs &lt;span style="color:blue;"&gt;As&lt;/span&gt; System.IO.FileStream&lt;br /&gt;&lt;br /&gt;Declaring an variable with type object called Late Binding,&lt;br /&gt;later this variable can hold any object type.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:green;"&gt;'  Create a variable to hold a new object&lt;/span&gt; &lt;span style="color:blue;"&gt;&lt;br /&gt;Dim&lt;/span&gt; anyObject &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Object&lt;br /&gt;or&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;Dim&lt;/span&gt; fs&lt;br /&gt;&lt;br /&gt;&lt;span style="color:green;"&gt;'  Later you can assign any object type to this variable&lt;br /&gt;&lt;/span&gt;anyObject = CreateObject(&lt;span style="color:maroon;"&gt;"Excel.Application"&lt;/span&gt;)&lt;br /&gt;or you can use the anyObject to hold any other your object type&lt;br /&gt;anyObject = CreateObject(&lt;span style="color:maroon;"&gt;"&lt;/span&gt;Define.Start&lt;span style="color:maroon;"&gt;"&lt;/span&gt;)&lt;br /&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-131559137914395908?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/131559137914395908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=131559137914395908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/131559137914395908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/131559137914395908'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/07/early-and-late-binding.html' title='Early and Late Binding'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-8577369119744905630</id><published>2009-07-10T12:54:00.000+05:30</published><updated>2009-07-14T18:39:38.250+05:30</updated><title type='text'>maintain scrollposition after post back?</title><content type='html'>&lt;p&gt;By default a web page will be returned to the top of the page, after a postback.  What if you want to take back to the position where user was before the postback ,  it's simple.  You can do one of the followings.&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;strong&gt;    1.For the whole website&lt;/strong&gt;&lt;br /&gt;In the web.config add the attribute to the pages  node.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;pages maintainscrollpositiononpostback="true"&gt;&lt;/pages&gt;&lt;/span&gt;&lt;/span&gt;&lt;pages maintainscrollpositiononpostback="true"&gt;&lt;/pages&gt;&lt;"pages maintainScrollPositionOnPostBack="true"&gt;&lt;/pages"&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: normal;font-family:arial;" &gt;&lt;pages maintainscrollpositiononpostback="true"&gt;&lt;/pages&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pages maintainscrollpositiononpostback="true"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/pages&gt;&lt;pages maintainscrollpositiononpostback="true"&gt;&lt;span style="font-weight: bold;"&gt;      &lt;/span&gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt;2&lt;/span&gt;.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; Particular page&lt;/span&gt;,&lt;br /&gt;    In the HTML (.ASPX)&lt;/pages&gt;&lt;pages maintainscrollpositiononpostback="true"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;      &lt; %@ Page Language="C#"      MaintainScrollPositionOnPostback = "true"&lt;/span&gt;   &lt;br /&gt;&lt;br /&gt;   and you can set this in&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    &lt;/span&gt;&lt;span&gt; &lt;span style="font-weight: bold;font-family:arial;font-size:85%;"  &gt;3&lt;/span&gt;.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;CODE&lt;/span&gt; (ASPX.SC)&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;  Page.MaintainScrollPositionOnPostBack = true;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That's all you have to do. You will be back to where you were.&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;/pages&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-8577369119744905630?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/8577369119744905630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=8577369119744905630' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8577369119744905630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/8577369119744905630'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/07/maintain-scrollposition-after-post-back.html' title='maintain scrollposition after post back?'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-869300521596270117</id><published>2009-06-10T12:38:00.000+05:30</published><updated>2009-06-10T13:17:32.390+05:30</updated><title type='text'>static Vs instance methods</title><content type='html'>Perfomance , instance methods are not virtual by default but can be declared as virtual. Virtual method has slightly high overhead than a non virtual method. Static methods are not virtual.&lt;br /&gt;So there might be a slight performance issue and this can be ignored as it's not make much impact on performance.&lt;br /&gt;&lt;br /&gt;Choosing your method to be static or instance will depend upon the design. If the method going to be used as an object then it should be an instance method. If it doesn't depend on an instance of an object, it should be static. Static methods belong to a type and instance methods belong to instance of a type.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;example&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Public Class Car&lt;br /&gt;{&lt;br /&gt;// this is a static method&lt;br /&gt;public &lt;span style="color:#ff0000;"&gt;static&lt;/span&gt; void&lt;span style="color:#000000;"&gt; staticMethod&lt;/span&gt;()&lt;br /&gt;{&lt;br /&gt;//your code&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// this is an instance method&lt;br /&gt;public void &lt;span style="color:#000000;"&gt;instanceMethod&lt;/span&gt;()&lt;br /&gt;{&lt;br /&gt;//your code&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Accessing static method&lt;br /&gt;Car.staticMethod();&lt;br /&gt;&lt;br /&gt;Accessing instance method&lt;br /&gt;Car car = new Car();&lt;br /&gt;car.instanceMethod();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-869300521596270117?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/869300521596270117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=869300521596270117' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/869300521596270117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/869300521596270117'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/06/static-vs-instance-methods.html' title='static Vs instance methods'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-4530149867084770202</id><published>2009-06-03T12:23:00.000+05:30</published><updated>2009-06-03T18:07:14.702+05:30</updated><title type='text'>Deployment Project - Cannot open the file 'ASPNETCOMPILER'</title><content type='html'>I got this error when I try to deploy an asp.net web site.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; "Cannot open the file 'ASPNETCOMPILER'. The document cannot be opened. It has been renamed,deleted or removed".&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8EXfgyXF23E/SiY7TCKvYuI/AAAAAAAAAA0/whsW26ooqE8/s1600-h/error.GIF"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 150px;" src="http://4.bp.blogspot.com/_8EXfgyXF23E/SiY7TCKvYuI/AAAAAAAAAA0/whsW26ooqE8/s200/error.GIF" alt="" id="BLOGGER_PHOTO_ID_5343023206107144930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The solution is, take your deployment project folder out  from the site folder (root).&lt;br /&gt;For example : if your project path is "&lt;span style="font-weight: bold;"&gt;D:\Projects\Ads&lt;/span&gt;" then have the deployment folder in "&lt;span style="font-weight: bold;"&gt;D:\&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Projects&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;\Deployment&lt;/span&gt;". &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Don't&lt;/span&gt; have the deployment folder in &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;site's folder itself as &lt;/span&gt;"&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;D:\Projects\Ads&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;\Deployment&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-4530149867084770202?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/4530149867084770202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=4530149867084770202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/4530149867084770202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/4530149867084770202'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/06/deployment-project-cannot-open-file.html' title='Deployment Project - Cannot open the file &apos;ASPNETCOMPILER&apos;'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_8EXfgyXF23E/SiY7TCKvYuI/AAAAAAAAAA0/whsW26ooqE8/s72-c/error.GIF' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-5210968436691718357</id><published>2009-06-01T15:35:00.000+05:30</published><updated>2009-06-01T17:29:26.657+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS 7'/><category scheme='http://www.blogger.com/atom/ns#' term='64-Bit'/><category scheme='http://www.blogger.com/atom/ns#' term='32-Bit'/><title type='text'>32-Bit application on 64-Bit server with IIS7</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Cshiran%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5Cshiran%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5Cshiran%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;Guys, I had to configure a website which is 32 bit, on a 64 bit server with IIS 7. As you know 64 bit servers doesn’t support 32 bit applications but lucky me, &lt;span style=""&gt; &lt;/span&gt;IIS has a feature to enable this&lt;/p&gt;&lt;p class="MsoNormal"&gt;.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8EXfgyXF23E/SiPBCg2jGKI/AAAAAAAAAAk/WqkphCWzF1k/s1600-h/iis7_cUT.gif"&gt;&lt;img style="cursor: pointer; width: 200px; height: 125px;" src="http://3.bp.blogspot.com/_8EXfgyXF23E/SiPBCg2jGKI/AAAAAAAAAAk/WqkphCWzF1k/s200/iis7_cUT.gif" alt="" id="BLOGGER_PHOTO_ID_5342325831914166434" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;It's so easy. In IIs go to Application Pool Right click on your web site and then go to "&lt;span style="font-weight: bold;"&gt;Advance Settings&lt;/span&gt;" , You will get a property called "&lt;span style="font-weight: bold;"&gt;Enable 32-Bit Applications&lt;/span&gt;" change its value to "&lt;span style="font-weight: bold;"&gt;True&lt;/span&gt;". That's all you have to do .&lt;br /&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-5210968436691718357?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/5210968436691718357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=5210968436691718357' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/5210968436691718357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/5210968436691718357'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/06/32-bit-application-on-64-bit-server.html' title='32-Bit application on 64-Bit server with IIS7'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_8EXfgyXF23E/SiPBCg2jGKI/AAAAAAAAAAk/WqkphCWzF1k/s72-c/iis7_cUT.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-1125985164238074962</id><published>2009-05-30T06:12:00.000+05:30</published><updated>2009-06-06T06:15:18.707+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOP with C#'/><category scheme='http://www.blogger.com/atom/ns#' term='encapsulation'/><category scheme='http://www.blogger.com/atom/ns#' term='Shiran'/><title type='text'>Scared on OOP.....</title><content type='html'>&lt;p&gt;Hay guys, You might be thinking why I am back on my blog after a long time. It's simply b'cause the encourage I got from one of my friends called Gogula and I use to call him gogus most of the time. Thanks man. Ok, here I start it again with OOP &amp;amp; C# .&lt;br /&gt;&lt;br /&gt;Before I start anything on this topic let me explain what is an object.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is an object?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ha, that could be anything around you in real world. For example your CPU.&lt;br /&gt;&lt;br /&gt;What we should consider of an object as a programmer? It's &lt;strong&gt;state &lt;/strong&gt;and the&lt;strong&gt; behavior.&lt;/strong&gt;&lt;br /&gt;I wil just take a scenario that would helpfull you to understand as a programmer, what is an object?. If you were asked to develop a student enrolment application what would you conside as your objects in this application. I will point two objects Student and the Course but there are many more, I will leave you to point after reading this blog. &lt;/p&gt;&lt;p&gt;As I have mentioned above we bothered about &lt;strong&gt;state&lt;/strong&gt; and the &lt;strong&gt;behavior&lt;/strong&gt; of an object.&lt;br /&gt;An object's state is the data and information it contains. For example, If you have a CPU object, it's state could be RAM speed and hard disck capacity. An object's bahavior represeted by it's methods. For example, in your CPU object play movie could be a method.&lt;br /&gt;&lt;br /&gt;There are three underline concepts&lt;br /&gt;Encapsulation&lt;br /&gt;Inheritance&lt;br /&gt;Polymorphism&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Encapsulation &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Encapsulation is a process of binding both data and methods together inside of an object.&lt;br /&gt;Protection and information hiding are techniques used to accomplish encapsulation of an&lt;br /&gt;object. Conside the following Class.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;public class Box{&lt;br /&gt;public Box()&lt;br /&gt;{&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;protected double height;&lt;br /&gt;protected double width;&lt;br /&gt;protected double length;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;public double GetVolume()&lt;br /&gt;{&lt;br /&gt;double volume = height*width*length;&lt;/p&gt;&lt;p&gt;if(volume&lt;0)&gt;&lt;p&gt;return volume;&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;}&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-1125985164238074962?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/1125985164238074962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=1125985164238074962' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/1125985164238074962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/1125985164238074962'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2009/05/scared-on-oop.html' title='Scared on OOP.....'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-117368351344858051</id><published>2007-03-12T13:37:00.001+05:30</published><updated>2007-03-12T13:46:52.356+05:30</updated><title type='text'>Classic ASP debugging</title><content type='html'>I was frustrated searching for ASP Classic debugger, eventually I found a stady way to do that...Open you ears widly.............&lt;br /&gt;&lt;br /&gt;use &lt;strong&gt;&lt;'% stop %''&gt;&lt;/strong&gt;it will break the execution on the stop statement and u can debug in VSInterDev.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-117368351344858051?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/117368351344858051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=117368351344858051' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/117368351344858051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/117368351344858051'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2007/03/classic-asp-debugging.html' title='Classic ASP debugging'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-117368369043265610</id><published>2007-03-12T13:37:00.000+05:30</published><updated>2007-03-12T13:44:50.433+05:30</updated><title type='text'>Classic ASP debugging</title><content type='html'>I was frustrated searching for ASP Classic debugger, eventually I found a stady way to do that...Open you ears widly.............&lt;br /&gt;&lt;br /&gt;"&lt;%Stop%&gt;"  this will do the magic&lt;br /&gt;... &lt;strong&gt;&lt;% stop %&gt;&lt;/strong&gt;it will break the execution on the stop statement and u can debug in VSInterDev.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-117368369043265610?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/117368369043265610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=117368369043265610' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/117368369043265610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/117368369043265610'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2007/03/classic-asp-debugging_12.html' title='Classic ASP debugging'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37107620.post-116261725136270138</id><published>2006-11-04T10:37:00.001+05:30</published><updated>2006-11-04T10:44:11.370+05:30</updated><title type='text'>CSS</title><content type='html'>I have been thinking about what are the best CSS practices. I got this from one of my friend. I’ll open it up to everyone for share it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Build and test your CSS in the most advanced browser available before testing in others, not after.&lt;br /&gt;If you build a site testing in a broken browser, your code begins relying on the broken rendering of that browser. When it comes time to test in a more standards-compliant browser, you will be frustrated when that browser renders it improperly. Instead, start from perfection and then hack for the less able browsers. Your code will be more standards-compliant from the start, and you won’t have to hack as much to support other browsers. Today, this means Mozilla, Safari, or Opera.&lt;br /&gt;Don’t use quotation marks around paths/URLs.&lt;br /&gt;When setting a background image, or loading in an imported file, resist the urge to surround the path with quote marks. They’re not necessary, and IE5/Mac will choke.&lt;br /&gt;Try to avoid applying padding/borders and a fixed width to an element.&lt;br /&gt;IE5 gets the box model wrong, which really makes a mess of things. There are &lt;a title="Box Model Hack" href="http://tantek.com/CSS/Examples/boxmodelhack.html"&gt;ways around this&lt;/a&gt;, but it’s best to side-step the issue by applying the padding to the parent element instead of the child that gets a fixed-width.&lt;br /&gt;Combine selectors.&lt;br /&gt;Keeping your CSS light is important to minimize download times; as much as possible, &lt;a href="http://www.w3.org/TR/CSS1#grouping"&gt;group&lt;/a&gt; selectors, rely on &lt;a href="http://www.w3.org/TR/CSS1#inheritance"&gt;inheritance&lt;/a&gt;, and reduce redundancy by using &lt;a href="http://www.w3.org/TR/CSS1#margin"&gt;shorthand&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37107620-116261725136270138?l=shirans.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shirans.blogspot.com/feeds/116261725136270138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37107620&amp;postID=116261725136270138' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/116261725136270138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37107620/posts/default/116261725136270138'/><link rel='alternate' type='text/html' href='http://shirans.blogspot.com/2006/11/css.html' title='CSS'/><author><name>Sheen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
