<?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:blogger='http://schemas.google.com/blogger/2008' 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-4910281762726240897</id><updated>2026-07-18T08:57:27.758+05:30</updated><title type='text'>C# and ASP.Net blogs</title><subtitle type='html'>This blogs gives you examples of C# and asp.net techniques.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>34</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-3202549199782664847</id><published>2015-03-15T20:52:00.002+05:30</published><updated>2015-03-15T20:52:30.912+05:30</updated><title type='text'>Conditionally Styling a columns rows in GridView Control</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;In .aspx.cs file Write the following code:&lt;/b&gt; &amp;nbsp;&lt;br /&gt;
private static int count = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs &amp;nbsp;e)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(!IsPostBack)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlConnection cn = new SqlConnection(&quot;data source=your sql server name;initial catalog=your db name;integrated security=sspi&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string qry = &quot;select * from employees&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmd = new SqlCommand(qry, cn);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlDataAdapter da = new SqlDataAdapter();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; da.SelectCommand = cmd;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataSet ds = new DataSet();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; da.Fill(ds);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Session[&quot;ds&quot;] = ds;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvEmps.DataSource = ds;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataTable dt = ds.Tables[0];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataColumn dc = new DataColumn(&quot;Eligibility&quot;,typeof(string));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dt.Columns.Add(dc);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvEmps.DataBind();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; protected void gvEmps_RowDataBound(object sender, GridViewRowEventArgs e)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (count &amp;gt; 0)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridViewRow gvr = e.Row;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TableCell tc = gvr.Cells[3];&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string data = tc.Text;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (data != &quot;&amp;nbsp;&quot;&amp;amp;&amp;amp;data!=&quot;doj&quot;)&lt;br /&gt;
&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; DateTime dt = Convert.ToDateTime(data);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int yrsDiff = DateTime.Now.Year - dt.Year;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (yrsDiff &amp;gt;= 5)&lt;br /&gt;
&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; TableCell tc1 = gvr.Cells[4];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tc1.Text = &quot;Eligible&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tc1.Style.Add(&quot;color&quot;, &quot;red&quot;);&lt;br /&gt;
&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; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (count == 0)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count = 1;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;b&gt;Table Structure:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; id=&quot;gvEmps&quot; rules=&quot;all&quot; style=&quot;border-collapse: collapse;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
   &lt;th scope=&quot;col&quot;&gt;eid&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;fname&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;age&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;doj&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;Eligibility&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;1&lt;/td&gt;&lt;td&gt;rijin&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;04-Oct-09 12:00:00 AM&lt;/td&gt;&lt;td style=&quot;color: red;&quot;&gt;Eligible&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;2&lt;/td&gt;&lt;td&gt;kishore&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;04-Oct-14 12:00:00 AM&lt;/td&gt;&lt;td&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/3202549199782664847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/3202549199782664847?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/3202549199782664847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/3202549199782664847'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2015/03/conditionally-styling-columns-rows-in.html' title='Conditionally Styling a columns rows in GridView Control'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-796802737680492818</id><published>2014-08-03T18:16:00.000+05:30</published><updated>2014-08-03T18:19:26.592+05:30</updated><title type='text'>Gridview with Hyperlink sample code</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;In .aspx file:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;asp:GridView ID=&quot;gvProducts&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;false&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;AlternatingRowStyle BackColor=&quot;green&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;Columns&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:HyperLinkField HeaderText=&quot;Name&quot; DataTextField=&quot;PName&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataNavigateUrlFields=&quot;pname&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataNavigateUrlFormatString=&quot;Sales.aspx?pname={0}&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:BoundField HeaderText=&quot;MinQty&quot; DataField=&quot;MinOrdQty&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:BoundField HeaderText=&quot;MaxQty&quot; DataField=&quot;MaxOrdQty&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:BoundField HeaderText=&quot;UnitPrice&quot; DataField=&quot;UnitPrice&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/Columns&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/asp:GridView&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;In .aspx.cs file:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string strcn = &quot;Data source=name-of-sql-server;initial catalog=database-name;integrated security=sspi&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlConnection cn = new SqlConnection(strcn);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmd = new SqlCommand(&quot;select pname,minordqty,MaxOrdQty,UnitPrice from dbo.products&quot;, cn);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataSet ds = new DataSet();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlDataAdapter DA = new SqlDataAdapter(cmd);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DA.Fill(ds);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataTable dt = ds.Tables[0];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Session[&quot;ds&quot;] = ds;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvProducts.DataSource = dt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvProducts.DataBind();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (SqlException ex)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finally&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;In Details page (Sales.aspx) :&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&amp;lt;asp:GridView ID=&quot;gvSales&quot; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:GridView&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;In Sales.aspx.cs:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Request.QueryString[&quot;pname&quot;] != null)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string productName = Request.QueryString[&quot;pname&quot;].ToString();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (productName != null &amp;amp;&amp;amp; productName != string.Empty)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DisplaySalesDetails(productName);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private void DisplaySalesDetails(string pname)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string strcn = &quot;Data source=ADMIN-PC\\SQLEXPRESS;initial catalog=adomaterial;integrated security=sspi&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlConnection cn = new SqlConnection(strcn);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string qry=@&quot;select * from dbo.sales where pid in(select pid from products&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; where pname=&#39;&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; qry+=pname+&quot;&#39;);&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmd = new SqlCommand(qry,cn);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataSet ds = new DataSet();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlDataAdapter DA = new SqlDataAdapter(cmd);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DA.Fill(ds);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Session[&quot;ds&quot;] = ds;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvSales.DataSource = ds;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvSales.DataBind();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (SqlException ex)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finally&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple;&quot;&gt;Table structure:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Products table:&lt;/b&gt;&lt;br /&gt;
&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; id=&quot;GridView1&quot; rules=&quot;all&quot; style=&quot;border-collapse: collapse;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
   &lt;th scope=&quot;col&quot;&gt;Pid&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;PName&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;Mid&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;MinOrdQty&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;MaxOrdQty&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;Active&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;UnitPrice&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;1&lt;/td&gt;&lt;td&gt;colgate&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;500&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_0&quot; name=&quot;GridView1$ctl02$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;65&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;2&lt;/td&gt;&lt;td&gt;DoveSoap&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;1000&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_1&quot; name=&quot;GridView1$ctl03$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;3&lt;/td&gt;&lt;td&gt;DoveShampoo&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;500&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_2&quot; name=&quot;GridView1$ctl04$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;150&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;4&lt;/td&gt;&lt;td&gt;ParachuteOil&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_3&quot; name=&quot;GridView1$ctl05$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;5&lt;/td&gt;&lt;td&gt;RinSoap&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;500&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_4&quot; name=&quot;GridView1$ctl06$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;6&lt;/td&gt;&lt;td&gt;SurfExcel&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;500&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_5&quot; name=&quot;GridView1$ctl07$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;55&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;7&lt;/td&gt;&lt;td&gt;VIM&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_6&quot; name=&quot;GridView1$ctl08$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;8&lt;/td&gt;&lt;td&gt;EXO&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;150&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_7&quot; name=&quot;GridView1$ctl09$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;9&lt;/td&gt;&lt;td&gt;Medimix&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;150&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_8&quot; name=&quot;GridView1$ctl10$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;10&lt;/td&gt;&lt;td&gt;Pears&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;200&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_9&quot; name=&quot;GridView1$ctl11$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;26&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;11&lt;/td&gt;&lt;td&gt;NoteBook&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;51&lt;/td&gt;&lt;td&gt;270&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_10&quot; name=&quot;GridView1$ctl12$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;48&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;12&lt;/td&gt;&lt;td&gt;Cinthol&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;300&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_11&quot; name=&quot;GridView1$ctl13$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;13&lt;/td&gt;&lt;td&gt;fiama&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;200&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView1_ctl00_12&quot; name=&quot;GridView1$ctl14$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;67&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;b&gt;Sales table:&lt;/b&gt;&lt;br /&gt;
&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; id=&quot;GridView2&quot; rules=&quot;all&quot; style=&quot;border-collapse: collapse;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
   &lt;th scope=&quot;col&quot;&gt;Sid&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;Qty&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;OriginalPrice&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;TotalPrice&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;Discount&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;Active&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;SaleDate&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;Pid&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;1&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;1350&lt;/td&gt;&lt;td&gt;1200&lt;/td&gt;&lt;td&gt;150&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_0&quot; name=&quot;GridView2$ctl02$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;23-Dec-11 12:00:00 AM&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;2&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;2000&lt;/td&gt;&lt;td&gt;1800&lt;/td&gt;&lt;td&gt;200&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_1&quot; name=&quot;GridView2$ctl03$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;21-Aug-11 12:00:00 AM&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;3&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;1300&lt;/td&gt;&lt;td&gt;1000&lt;/td&gt;&lt;td&gt;300&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_2&quot; name=&quot;GridView2$ctl04$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;13-Jun-10 12:00:00 AM&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;4&lt;/td&gt;&lt;td&gt;150&lt;/td&gt;&lt;td&gt;5500&lt;/td&gt;&lt;td&gt;4900&lt;/td&gt;&lt;td&gt;600&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_3&quot; name=&quot;GridView2$ctl05$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;23-Dec-09 12:00:00 AM&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;5&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;1300&lt;/td&gt;&lt;td&gt;1100&lt;/td&gt;&lt;td&gt;200&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_4&quot; name=&quot;GridView2$ctl06$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;02-Jun-08 12:00:00 AM&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;6&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;375&lt;/td&gt;&lt;td&gt;350&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_5&quot; name=&quot;GridView2$ctl07$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;01-Feb-12 12:00:00 AM&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;7&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;3375&lt;/td&gt;&lt;td&gt;3100&lt;/td&gt;&lt;td&gt;275&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_6&quot; name=&quot;GridView2$ctl08$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;02-Feb-11 12:00:00 AM&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;8&lt;/td&gt;&lt;td&gt;200&lt;/td&gt;&lt;td&gt;3000&lt;/td&gt;&lt;td&gt;2500&lt;/td&gt;&lt;td&gt;500&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_7&quot; name=&quot;GridView2$ctl09$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;07-Oct-10 12:00:00 AM&lt;/td&gt;&lt;td&gt;5&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;9&lt;/td&gt;&lt;td&gt;150&lt;/td&gt;&lt;td&gt;3300&lt;/td&gt;&lt;td&gt;3200&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_8&quot; name=&quot;GridView2$ctl10$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;29-Jul-11 12:00:00 AM&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;10&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;3500&lt;/td&gt;&lt;td&gt;3200&lt;/td&gt;&lt;td&gt;300&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_9&quot; name=&quot;GridView2$ctl11$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;15-Nov-10 12:00:00 AM&lt;/td&gt;&lt;td&gt;8&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;11&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;550&lt;/td&gt;&lt;td&gt;500&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_10&quot; name=&quot;GridView2$ctl12$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;02-Feb-11 12:00:00 AM&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;12&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;1100&lt;/td&gt;&lt;td&gt;1000&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_11&quot; name=&quot;GridView2$ctl13$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;11-Aug-09 12:00:00 AM&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;13&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;td&gt;1200&lt;/td&gt;&lt;td&gt;950&lt;/td&gt;&lt;td&gt;250&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_12&quot; name=&quot;GridView2$ctl14$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;23-Dec-10 12:00:00 AM&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;14&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;2500&lt;/td&gt;&lt;td&gt;900&lt;/td&gt;&lt;td&gt;400&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_13&quot; name=&quot;GridView2$ctl15$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;20-Oct-11 12:00:00 AM&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;15&lt;/td&gt;&lt;td&gt;120&lt;/td&gt;&lt;td&gt;1600&lt;/td&gt;&lt;td&gt;1500&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;&lt;span class=&quot;aspNetDisabled&quot;&gt;&lt;input checked=&quot;checked&quot; disabled=&quot;disabled&quot; id=&quot;GridView2_ctl00_14&quot; name=&quot;GridView2$ctl16$ctl00&quot; type=&quot;checkbox&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;03-Oct-12 12:00:00 AM&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/796802737680492818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/796802737680492818?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/796802737680492818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/796802737680492818'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2014/08/gridview-with-hyperlink-sample-code.html' title='Gridview with Hyperlink sample code'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-1036098223659597503</id><published>2014-07-22T10:02:00.002+05:30</published><updated>2014-07-22T10:02:28.349+05:30</updated><title type='text'>Paging in GridView</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;In .aspx file :&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;lt;asp:GridView ID=&quot;GridView1&quot; runat=&quot;server&quot; PageSize=&quot;5&quot; AllowPaging=&quot;true&quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; onpageindexchanging=&quot;GridView1_PageIndexChanging&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;lt;PagerSettings Mode=&quot;Numeric&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;lt;/asp:GridView&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;In .aspx.cs file :&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;public partial class ADO_DATACONTROLS_Paging : System.Web.UI.Page&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //sspi=Security Support Provider Interface ~= trusted connection&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(!IsPostBack)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DisplayEmployees();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; private void DisplayEmployees()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string strcn = &quot;data source=ADMIN-PC\\SQLEXPRESS;initial catalog=db17;integrated security=sspi&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlConnection cn = new SqlConnection(strcn);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmd = new SqlCommand(&quot;select * from employees&quot;, cn);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataSet ds = new DataSet();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlDataAdapter DA = new SqlDataAdapter(cmd);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DA.Fill(ds);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Session[&quot;ds&quot;] = ds;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataSource = ds;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataBind();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (SqlException ex)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finally&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataSet ds = (DataSet)Session[&quot;ds&quot;];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataTable dt = ds.Tables[0];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataSource = dt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.PageIndex = e.NewPageIndex;//this code must be written between Datasource and DataBind&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataBind();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: blue;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h3 style=&quot;color: blue; text-align: left;&quot;&gt;
Table structure:&lt;/h3&gt;
&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; id=&quot;GridView1&quot; rules=&quot;all&quot; style=&quot;border-collapse: collapse; color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
   &lt;th scope=&quot;col&quot;&gt;eid&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;fname&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;lname&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;age&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;salary&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;dept&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;doj&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;1&lt;/td&gt;&lt;td&gt;rajeev&lt;/td&gt;&lt;td&gt;sukla&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;12000&lt;/td&gt;&lt;td&gt;.net&lt;/td&gt;&lt;td&gt;23-Oct-11 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;2&lt;/td&gt;&lt;td&gt;sowmya&lt;/td&gt;&lt;td&gt;kumari&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;19000&lt;/td&gt;&lt;td&gt;db&lt;/td&gt;&lt;td&gt;13-Nov-10 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;3&lt;/td&gt;&lt;td&gt;kishore&lt;/td&gt;&lt;td&gt;kumar&lt;/td&gt;&lt;td&gt;27&lt;/td&gt;&lt;td&gt;36000&lt;/td&gt;&lt;td&gt;android&lt;/td&gt;&lt;td&gt;16-Oct-11 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;4&lt;/td&gt;&lt;td&gt;abimanyu&lt;/td&gt;&lt;td&gt;biswal&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt;null&lt;/td&gt;&lt;td&gt;android&lt;/td&gt;&lt;td&gt;20-Feb-10 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;5&lt;/td&gt;&lt;td&gt;soni&lt;/td&gt;&lt;td&gt;kumar&lt;/td&gt;&lt;td&gt;24&lt;/td&gt;&lt;td&gt;21800&lt;/td&gt;&lt;td&gt;.net&lt;/td&gt;&lt;td&gt;21-Jun-09 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;6&lt;/td&gt;&lt;td&gt;anu&lt;/td&gt;&lt;td&gt;_singh&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt;12000&lt;/td&gt;&lt;td&gt;db&lt;/td&gt;&lt;td&gt;23-Oct-10 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;7&lt;/td&gt;&lt;td&gt;_dinesh&lt;/td&gt;&lt;td&gt;moh%anty&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;15000&lt;/td&gt;&lt;td&gt;.net&lt;/td&gt;&lt;td&gt;26-Aug-09 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;8&lt;/td&gt;&lt;td&gt;nishala&lt;/td&gt;&lt;td&gt;_kumari&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt;18000&lt;/td&gt;&lt;td&gt;db&lt;/td&gt;&lt;td&gt;19-Jul-08 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;1&lt;/td&gt;&lt;td&gt;rajeev&lt;/td&gt;&lt;td&gt;sukla&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;12000&lt;/td&gt;&lt;td&gt;.net&lt;/td&gt;&lt;td&gt;23-Oct-11 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/1036098223659597503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/1036098223659597503?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/1036098223659597503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/1036098223659597503'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2014/07/paging-in-gridview.html' title='Paging in GridView'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-8472638714053704618</id><published>2014-07-22T09:55:00.001+05:30</published><updated>2014-07-22T09:57:09.468+05:30</updated><title type='text'>Sorting in Gridview Control</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Write the following code In .aspx page :&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&amp;lt;asp:GridView ID=&quot;gvstudents&quot; runat=&quot;server&quot; AllowSorting=&quot;true&quot;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;
&lt;/b&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; OnSorting=&quot;gvstudents_sorting&quot;&amp;gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;
&lt;/b&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/asp:GridView&amp;gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;
&lt;/b&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Code in .aspx.cs:&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;public partial class SortingEx : System.Web.UI.Page&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;
&lt;/span&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(!IsPostBack)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string strcon = &quot;data source=name of sql server ;initial catalog=database name;integrated security=sspi or user id=sqlserver userid ; password=somepassword&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string sConnection = strcon;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataSet ds = new DataSet();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlConnection cn = new SqlConnection(sConnection);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (cn)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmd = new SqlCommand(&quot;select * from employees&quot;, cn);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (cmd)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlDataAdapter da = new SqlDataAdapter();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; da.SelectCommand = cmd;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; da.Fill(ds);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvstudents.DataSource = ds;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvstudents.DataBind();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Session[&quot;ds&quot;] = ds;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ViewState[&quot;sortcolumn&quot;] = string.Empty;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ViewState[&quot;sortdirection&quot;] = string.Empty;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void gvstudents_sorting(object sender, GridViewSortEventArgs e)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Session[&quot;ds&quot;] != null)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataSet ds = (DataSet)Session[&quot;ds&quot;];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataTable dt = ds.Tables[0];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataView dv = dt.DefaultView;//DataView ado.net view in t-sql&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (ViewState[&quot;sortcolumn&quot;].ToString() == e.SortExpression.ToString())&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (&quot;asc&quot; == ViewState[&quot;sortdirection&quot;].ToString())&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ViewState[&quot;sortdirection&quot;] = &quot;DESC&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ViewState[&quot;sortdirection&quot;] = &quot;asc&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ViewState[&quot;sortcolumn&quot;] = e.SortExpression.ToString();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ViewState[&quot;sortdirection&quot;] = &quot;asc&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (dv != null)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dv.Sort = e.SortExpression + &quot; &quot; + ViewState[&quot;sortdirection&quot;].ToString();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //dv.Sort= &quot;ename asc&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvstudents.DataSource = dv;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvstudents.DataBind();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: blue;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;color: blue; text-align: left;&quot;&gt;
Table structure :&lt;/h3&gt;
&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; id=&quot;GridView1&quot; rules=&quot;all&quot; style=&quot;border-collapse: collapse; color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
   &lt;th scope=&quot;col&quot;&gt;eid&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;fname&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;lname&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;age&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;salary&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;dept&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;doj&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;1&lt;/td&gt;&lt;td&gt;rajeev&lt;/td&gt;&lt;td&gt;sukla&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;12000&lt;/td&gt;&lt;td&gt;.net&lt;/td&gt;&lt;td&gt;23-Oct-11 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;2&lt;/td&gt;&lt;td&gt;sowmya&lt;/td&gt;&lt;td&gt;kumari&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;19000&lt;/td&gt;&lt;td&gt;db&lt;/td&gt;&lt;td&gt;13-Nov-10 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;3&lt;/td&gt;&lt;td&gt;kishore&lt;/td&gt;&lt;td&gt;kumar&lt;/td&gt;&lt;td&gt;27&lt;/td&gt;&lt;td&gt;36000&lt;/td&gt;&lt;td&gt;android&lt;/td&gt;&lt;td&gt;16-Oct-11 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;4&lt;/td&gt;&lt;td&gt;abimanyu&lt;/td&gt;&lt;td&gt;biswal&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt;null&lt;/td&gt;&lt;td&gt;android&lt;/td&gt;&lt;td&gt;20-Feb-10 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;5&lt;/td&gt;&lt;td&gt;soni&lt;/td&gt;&lt;td&gt;kumar&lt;/td&gt;&lt;td&gt;24&lt;/td&gt;&lt;td&gt;21800&lt;/td&gt;&lt;td&gt;.net&lt;/td&gt;&lt;td&gt;21-Jun-09 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;6&lt;/td&gt;&lt;td&gt;anu&lt;/td&gt;&lt;td&gt;_singh&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt;12000&lt;/td&gt;&lt;td&gt;db&lt;/td&gt;&lt;td&gt;23-Oct-10 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;7&lt;/td&gt;&lt;td&gt;_dinesh&lt;/td&gt;&lt;td&gt;moh%anty&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;15000&lt;/td&gt;&lt;td&gt;.net&lt;/td&gt;&lt;td&gt;26-Aug-09 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;8&lt;/td&gt;&lt;td&gt;nishala&lt;/td&gt;&lt;td&gt;_kumari&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt;18000&lt;/td&gt;&lt;td&gt;db&lt;/td&gt;&lt;td&gt;19-Jul-08 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;1&lt;/td&gt;&lt;td&gt;rajeev&lt;/td&gt;&lt;td&gt;sukla&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;12000&lt;/td&gt;&lt;td&gt;.net&lt;/td&gt;&lt;td&gt;23-Oct-11 12:00:00 AM&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;color: blue;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/8472638714053704618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/8472638714053704618?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/8472638714053704618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/8472638714053704618'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2014/07/sorting-in-gridview-control.html' title='Sorting in Gridview Control'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-4726164567528508510</id><published>2014-07-21T09:50:00.003+05:30</published><updated>2014-07-21T09:52:35.570+05:30</updated><title type='text'>Asp.net Gridview edit update and delete code</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;In GridViewEditUpdateDelete.aspx add the following code ( in the form tag )&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;br /&gt;
&amp;lt;asp:GridView ID=&quot;gvPatients&quot; AutoGenerateColumns=&quot;false&quot; runat=&quot;server&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; AutoGenerateEditButton=&quot;true&quot; AutoGenerateDeleteButton=&quot;true&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; DataKeyNames=&quot;PatientID&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; onrowediting=&quot;gvPatients_RowEditing&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OnRowCancelingEdit=&quot;gvPatients_RowCancel&quot; OnRowUpdating=&quot;gvPatients_RowUpdating&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OnRowDeleting=&quot;gvPatients_RowDeleting&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; onselectedindexchanged=&quot;gvPatients_SelectedIndexChanged&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;HeaderStyle BackColor=&quot;AliceBlue&quot; ForeColor=&quot;Red&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;Columns&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:TemplateField HeaderText=&quot;PatientID&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:Label ID=&quot;lblPatientID&quot; runat=&quot;server&quot; Text=&#39;&amp;lt;%#Eval(&quot;PatientID&quot;) %&amp;gt;&#39;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/asp:TemplateField&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:TemplateField HeaderText=&quot;PatientName&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;EditItemTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:TextBox ID=&quot;tbName&quot; runat=&quot;server&quot; Text=&#39;&amp;lt;%#Eval(&quot;PatientName&quot;)%&amp;gt;&#39; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/EditItemTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:Label ID=&quot;lblName&quot; runat=&quot;server&quot; Text=&#39;&amp;lt;%#DataBinder.Eval(Container.DataItem,&quot;PatientName&quot;)%&amp;gt;&#39; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/asp:TemplateField&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:TemplateField HeaderText=&quot;AGE&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;EditItemTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:TextBox ID=&quot;tbAge&quot; runat=&quot;server&quot; Text=&#39;&amp;lt;%#Eval(&quot;age&quot;)%&amp;gt;&#39; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/EditItemTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:Label ID=&quot;lblAge&quot; runat=&quot;server&quot; Text=&#39;&amp;lt;%#Eval(&quot;age&quot;)%&amp;gt;&#39; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/asp:TemplateField&amp;gt; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/Columns&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/asp:GridView&amp;gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white; color: blue;&quot;&gt;In .aspx.cs page add the following code:&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;public partial class DataGridColumns : System.Web.UI.Page&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
{&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; DataSet ds = new DataSet();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!IsPostBack)&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FillPatientInfo();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; private void FillPatientInfo()&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //bad approach for getting connection string.&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string strcon = &quot;data source=your sql server name ;initial catalog=your database name ;integrated security=sspi&quot;;&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlConnection cn = new SqlConnection(strcon);&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmd = new SqlCommand(&quot;select * from patient&quot;, cn);&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlDataAdapter da = new SqlDataAdapter();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; da.SelectCommand = cmd;&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; da.Fill(ds);&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvPatients.DataSource = ds;&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvPatients.DataBind();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Session[&quot;dsPatients&quot;] = ds;&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //GridView1.DataSource = ds;&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //GridView1.DataBind();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; protected void gvPatients_RowEditing(object sender, GridViewEditEventArgs e)&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvPatients.EditIndex = e.NewEditIndex;&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvPatients.DataSource = (DataSet)Session[&quot;dsPatients&quot;];&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvPatients.DataBind();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; protected void gvPatients_RowDeleting(object sender, GridViewDeleteEventArgs e)&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Label lblPatientID = (Label)gvPatients.Rows[e.RowIndex].FindControl(&quot;lblPatientID&quot;);&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlConnection cn = new SqlConnection(&quot;data source=ADMIN-PC\\SQLEXPRESS;initial catalog=palletechnologies;integrated security=sspi&quot;);&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmd = new SqlCommand();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; StringBuilder sb = new StringBuilder();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sb.Append(&quot;delete patient where patientid=&#39;&quot; + lblPatientID.Text + &quot;&#39;&quot;);&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.CommandText = sb.ToString();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Connection = cn;&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.ExecuteNonQuery();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FillPatientInfo();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; protected void gvPatients_RowUpdating(object sender, GridViewUpdateEventArgs e)&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Label lblPatientID = (Label)gvPatients.Rows[e.RowIndex].FindControl(&quot;lblPatientID&quot;);&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextBox tbAge = (TextBox)gvPatients.Rows[e.RowIndex].FindControl(&quot;tbAge&quot;);&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextBox tbName = (TextBox)gvPatients.Rows[e.RowIndex].FindControl(&quot;tbName&quot;);&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlConnection cn = new SqlConnection(&quot;data source=ADMIN-PC\\SQLEXPRESS;initial catalog=palletechnologies;integrated security=sspi&quot;);&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmd = new SqlCommand();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; StringBuilder sb = new StringBuilder();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sb.Append(&quot;update patient set patientname=&#39;&quot; + tbName .Text+ &quot;&#39;,&quot;);&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sb.Append(&quot;age=&#39;&quot;+tbAge.Text+&quot;&#39; where patientid=&#39;&quot;+lblPatientID.Text+&quot;&#39;&quot;);&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.CommandText = sb.ToString();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Connection = cn;&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.ExecuteNonQuery();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvPatients.EditIndex = -1;&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FillPatientInfo();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; protected void gvPatients_SelectedIndexChanged(object sender, EventArgs e)&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; protected void gvPatients_RowCancel(object sender, GridViewCancelEditEventArgs e)&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvPatients.EditIndex = -1;&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.Cancel = true;&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvPatients.DataSource = (DataSet)Session[&quot;dsPatients&quot;];&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvPatients.DataBind();&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;color: #666666;&quot;&gt;
}&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Patient table structure:&amp;nbsp;&lt;/span&gt;&lt;/h4&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Create a patient table with PatientID,PatientName and Age columns.&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/4726164567528508510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/4726164567528508510?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/4726164567528508510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/4726164567528508510'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2014/07/aspnet-gridview-edit-update-and-delete.html' title='Asp.net Gridview edit update and delete code'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-7297964682159140882</id><published>2014-04-10T00:22:00.001+05:30</published><updated>2014-04-10T00:22:21.789+05:30</updated><title type='text'>How to set startup url in asp.net mvc</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
1.Go to MVC web application property page and set Start Action Specific Page value equal to ControllerName/ActionMethodName ( refer below given screen shot )&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNV2jlgeptNUxX2KurB1txqnBx69GqOwcbLO05S-BpfJ9k_PFZoqVMMrLE_lQYlFGNQUo-6eebyxq04P_qioXFEE3GBqQ_fL-C9oQeRWb7XZteEVd2Id9g40rBz1pyDBlmu-T9AgLbEXE/s1600/Untitled.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNV2jlgeptNUxX2KurB1txqnBx69GqOwcbLO05S-BpfJ9k_PFZoqVMMrLE_lQYlFGNQUo-6eebyxq04P_qioXFEE3GBqQ_fL-C9oQeRWb7XZteEVd2Id9g40rBz1pyDBlmu-T9AgLbEXE/s1600/Untitled.jpg&quot; height=&quot;200&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/7297964682159140882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/7297964682159140882?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/7297964682159140882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/7297964682159140882'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2014/04/how-to-set-startup-url-in-aspnet-mvc.html' title='How to set startup url in asp.net mvc'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNV2jlgeptNUxX2KurB1txqnBx69GqOwcbLO05S-BpfJ9k_PFZoqVMMrLE_lQYlFGNQUo-6eebyxq04P_qioXFEE3GBqQ_fL-C9oQeRWb7XZteEVd2Id9g40rBz1pyDBlmu-T9AgLbEXE/s72-c/Untitled.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-723218360111467421</id><published>2013-12-20T18:46:00.000+05:30</published><updated>2014-04-10T00:01:22.997+05:30</updated><title type='text'>What is an action method in MVC </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
An action method in mvc is a method which can able to redirect user to a view ( an action method can optionally pass model data to a view for rendering views ui filled with model data ).&lt;br /&gt;
OR&lt;br /&gt;
An action method is a method which is returning ActionResult .&lt;br /&gt;
&lt;br /&gt;
Note: I For testing your knowledge in .net , c , cpp , aptitude , java and arithmetic you can visit the links present http://www.skillgun.com&lt;br /&gt;
&lt;br /&gt;
Important links in skillgun .&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://skillgun.com/arithmetic/questions-and-answers&quot;&gt;arithmetic questions and answers&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://skillgun.com/android/interview-questions-and-answers&quot;&gt;android interview questions and answers&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://skillgun.com/c/interview-questions-and-answers&quot;&gt;c interview questions and answers&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://skillgun.com/cpp/interview-questions-and-answers&quot;&gt;c++ interview questions and answers&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://skillgun.com/java/interview-questions-and-answers&quot;&gt;java interview questions and answers&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://skillgun.com/csharp/interview-questions-and-answers&quot;&gt;c# interview questions and answers&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/723218360111467421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/723218360111467421?isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/723218360111467421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/723218360111467421'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2013/12/what-is-action-method-in-mvc.html' title='What is an action method in MVC '/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-8724071195667520124</id><published>2011-11-08T12:39:00.001+05:30</published><updated>2011-11-08T12:39:57.470+05:30</updated><title type='text'>About Global.asax in ASP.NET</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Global.asax is a file in asp.net&lt;/li&gt;
&lt;li&gt;Global.asax file contains all the application level methods.like&lt;/li&gt;
&lt;li&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 1.Application_Start 2.Application_End 3.Session_Start 4.Session_End etc..&lt;/li&gt;
&lt;li&gt;Note: When you compile your code for the first time your ASP.NET runtime creates a class corresponding to Global.asax file with the Class name &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;global_asax&lt;/b&gt;&lt;/span&gt;. This class inherits from&amp;nbsp;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #274e13;&quot;&gt;HTTP&amp;nbsp;Application&lt;/span&gt;&lt;/b&gt; class.&lt;/li&gt;
&lt;li&gt;You can see the&amp;nbsp;automatically&amp;nbsp;created class in the&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;C:\Documents and Settings\User\My Documents\Visual Studio 2008\WebSites\ApplicationName\global.asax&lt;/b&gt;&lt;/span&gt; file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/8724071195667520124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/8724071195667520124?isPopup=true' title='19 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/8724071195667520124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/8724071195667520124'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/11/about-globalasax-in-aspnet.html' title='About Global.asax in ASP.NET'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>19</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-2781285384814685096</id><published>2011-10-28T10:08:00.002+05:30</published><updated>2014-07-05T19:08:19.538+05:30</updated><title type='text'>Adding new Nodes to XML File in C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;1.Create a Dummy xml file with the name Patients.xml in your solution explorer.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; Ex:&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&lt;patients&gt;&lt;/patients&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;lt;Patients&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;lt;Patient type=&quot;IP&quot;&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;lt;VistorNum&amp;gt;134&amp;lt;/VistorNum&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;lt;FName&amp;gt;Maha&amp;lt;/FName&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;lt;LName&amp;gt;Veer&amp;lt;/LName&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;lt;Age&amp;gt;89&amp;lt;/Age&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;lt;Sex&amp;gt;Male&amp;lt;/Sex&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;lt;/Patient&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;lt;/Patients&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;b&gt;2.Create the UI to accept data from users.(Write the below code in .aspx page)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;VisitorNum:&amp;lt;asp:TextBox ID=&quot;tbVstrNum&quot; runat=&quot;server&quot; &amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; FName:&amp;lt;asp:TextBox ID=&quot;tbFName&quot; runat=&quot;server&quot; &amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; LName:&amp;lt;asp:TextBox ID=&quot;tbLName&quot; runat=&quot;server&quot; &amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; Age:&amp;lt;asp:TextBox ID=&quot;tbAge&quot; runat=&quot;server&quot; &amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; Sex:&amp;lt;asp:TextBox ID=&quot;tbSex&quot; runat=&quot;server&quot; &amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;lt;asp:Button ID=&quot;btnInsertPat&quot; Text=&quot;AddPatient&quot; runat=&quot;server&quot;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; onclick=&quot;btnInsertPat_Click&quot; /&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;b&gt;3.Write the below code in code behind&#39;s button click method.&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;protected void btnInsertPat_Click(object sender, EventArgs e)&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; {&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlDocument doc = new XmlDocument();&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc.Load(Server.MapPath(&quot;Patients.xml&quot;));&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Create a New patient node.&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlNode nPatient=doc.CreateNode(XmlNodeType.Element,&quot;Patient&quot;,null);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Create visitornUm,FName,LName,Age,Sex nodes and add&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //it to Patient Node&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlElement eVistNum= doc.CreateElement(&quot;VistorNum&quot;);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; eVistNum.InnerText = tbVstrNum.Text;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlElement eFName = doc.CreateElement(&quot;FName&quot;);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; eFName.InnerText = tbFName.Text;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlElement eLName = doc.CreateElement(&quot;LName&quot;);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; eLName.InnerText = tbLName.Text;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlElement eAge = doc.CreateElement(&quot;Age&quot;);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; eAge.InnerText = tbAge.Text;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlElement eSex = doc.CreateElement(&quot;Sex&quot;);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; eSex.InnerText = tbSex.Text;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nPatient.AppendChild(eVistNum);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nPatient.AppendChild(eFName);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nPatient.AppendChild(eLName);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nPatient.AppendChild(eAge);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nPatient.AppendChild(eSex);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Get the Root Patients Node ref.&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlNode root=doc.SelectSingleNode(&quot;Patients&quot;);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Add New patient node to root patient node.&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; root.AppendChild(nPatient);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string sPath = Server.MapPath(&quot;Patients.xml&quot;);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc.Save(sPath);&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //elem.AppendChild(&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; }&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://techpalle.com/net-training-in-bangalore.aspx&quot; target=&quot;_blank&quot;&gt;Sign Up for dot net training course&lt;/a&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/2781285384814685096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/2781285384814685096?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/2781285384814685096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/2781285384814685096'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/10/adding-new-nodes-to-xml-file-in-c.html' title='Adding new Nodes to XML File in C#'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-2844626981665273039</id><published>2011-09-09T13:54:00.000+05:30</published><updated>2014-07-05T19:09:21.222+05:30</updated><title type='text'>Opening My Computer Using ASP.NET</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Please use the HTML Input File Control for opening all the available Drives. Just Drag and drop the control&lt;br /&gt;
on to the .aspx page and check the result by clicking on the Browse Button.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://techpalle.com/net-training-in-bangalore.aspx&quot;&gt;India&#39;s #1 .NET Training&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/2844626981665273039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/2844626981665273039?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/2844626981665273039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/2844626981665273039'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/09/opening-my-computer-using-aspnet.html' title='Opening My Computer Using ASP.NET'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-6969876205410149214</id><published>2011-08-28T17:09:00.000+05:30</published><updated>2011-08-28T17:14:31.740+05:30</updated><title type='text'>How to Encrypt Connection String</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;For security reasons we need to encrypt the connection strings.&lt;br /&gt;
Encrypting and decrypting the connection string is very easy. Follow the Below steps to encrypt the Connection strings.&lt;br /&gt;
Encrypt Connection Strings:&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Open visual studio command prompt.&lt;/li&gt;
&lt;li&gt;type the given command &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;aspnet_regiis -pef &amp;nbsp;&quot;connectionStrings&quot; &amp;nbsp;&quot;YourApplicationFullPath where your web.config file is present&quot; &amp;nbsp;&lt;/span&gt;and then press Enter.&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5-xyXza7sCDAwscHUKradqv0XuhGBJIazFaoWG0IDhRq6tZCkzz1uDtnM9dZSVISbfNlG34r9lvG2n3jtZMTnuH2x_u2KJwAUOBjlRl48nhLhUhcXrEBBADwIwbMKI9A9ZC5qxXY-TIE/s1600/Encrypting.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;83&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5-xyXza7sCDAwscHUKradqv0XuhGBJIazFaoWG0IDhRq6tZCkzz1uDtnM9dZSVISbfNlG34r9lvG2n3jtZMTnuH2x_u2KJwAUOBjlRl48nhLhUhcXrEBBADwIwbMKI9A9ZC5qxXY-TIE/s320/Encrypting.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;Decrypting Connection String:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;aspnet_regiis -pdf &amp;nbsp;&quot;connectionStrings&quot;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&quot;YourApplicationFullPath where your web.config file is present&quot; &amp;nbsp;&lt;/span&gt;and then press Enter.&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMbVGtIuLA7b45IhhyGuxQfpS_kHPBfXjJfWmk_aGGjc1y4AqPcLqwFDQ8Vbjvix69UM5FJD2HkX5odsmzsmFAYW6QYA0W7aIbNN6i6HyQ3OnatGVbb2wpjSg6i_Ogl9a0DbdCYMptxiE/s1600/Decrypting.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;83&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMbVGtIuLA7b45IhhyGuxQfpS_kHPBfXjJfWmk_aGGjc1y4AqPcLqwFDQ8Vbjvix69UM5FJD2HkX5odsmzsmFAYW6QYA0W7aIbNN6i6HyQ3OnatGVbb2wpjSg6i_Ogl9a0DbdCYMptxiE/s320/Decrypting.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;Note : You need to use pef or pdf only if your website is created as a file system. If Your website is created as a IIS website then use pe or pd for encrypting or decrypting.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/6969876205410149214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/6969876205410149214?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/6969876205410149214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/6969876205410149214'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/08/how-to-encrypt-connection-string.html' title='How to Encrypt Connection String'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5-xyXza7sCDAwscHUKradqv0XuhGBJIazFaoWG0IDhRq6tZCkzz1uDtnM9dZSVISbfNlG34r9lvG2n3jtZMTnuH2x_u2KJwAUOBjlRl48nhLhUhcXrEBBADwIwbMKI9A9ZC5qxXY-TIE/s72-c/Encrypting.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-6206296099749447817</id><published>2011-08-18T15:40:00.000+05:30</published><updated>2014-07-05T19:03:44.014+05:30</updated><title type='text'>is and as operators in C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;is Operator:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;is operator Checks if an object is compatible with a given type&amp;nbsp;&lt;/li&gt;
&lt;li&gt;An is expression evaluates to true if the provided expression is non-null,&amp;nbsp;and the provided object &amp;nbsp; &amp;nbsp; can &amp;nbsp;be cast to the provided type without causing&amp;nbsp;&amp;nbsp;an exception to be thrown.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;as Operator:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;The as operator is used to perform conversions between compatible reference types &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/li&gt;
&lt;li&gt;The as operator is like a cast operation. However, if the conversion is not possible,&amp;nbsp;as returns null instead of raising an exception&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;Ex:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;public class Exam&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; public string GetSubjectName()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;C#&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;public class UnitTest&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; public int GetTestNumber()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 1;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;public partial class CSHARPSAMPLES_Keywords : System.Web.UI.Page&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Exam e1 = new Exam();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; public void Test(object o)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (o is UnitTest)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UnitTest u = o as UnitTest;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; u.GetTestNumber();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else if (o is Exam)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Exam e = o as Exam;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.GetSubjectName();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/6206296099749447817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/6206296099749447817?isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/6206296099749447817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/6206296099749447817'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/08/is-and-as-operators-in-c.html' title='is and as operators in C#'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-6189922636219116686</id><published>2011-08-18T08:13:00.000+05:30</published><updated>2014-07-05T19:05:58.523+05:30</updated><title type='text'>Ternary Operators in C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Ternary operators can be&amp;nbsp;use full&amp;nbsp;when we have only one simple if else condition.&lt;br /&gt;
Ternary Operator Syntax:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace; font-size: 13px; font-style: normal; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;condition ? first_expression : second_expression;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace; font-size: 13px; font-style: normal; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75;&quot;&gt;Ex:&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75; font-family: Consolas, Courier, monospace;&quot;&gt;&lt;b&gt;public class TernaryEx
{
    public int GetBigNum(int a, int b)
    {
        return a &amp;gt; b ? a : b;
        //in the above syntax if a is greater than b
        //the above expression returns a else it returns b.
    }
}&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #351c75; font-family: Consolas, Courier, monospace;&quot;&gt;&lt;b&gt;Note: SignUp for &lt;a href=&quot;http://techpalle.com/net-training-in-bangalore.aspx&quot; target=&quot;_blank&quot;&gt;JobGuaranteed Training&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/6189922636219116686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/6189922636219116686?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/6189922636219116686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/6189922636219116686'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/08/ternary-operators-in-c.html' title='Ternary Operators in C#'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-8859649470947086409</id><published>2011-07-17T20:23:00.000+05:30</published><updated>2011-07-17T20:31:39.816+05:30</updated><title type='text'>How to show XML Data in the Grid View</title><content type='html'>&lt;ul&gt;&lt;li&gt;Create a Page with the Name XMLSample.aspx&lt;/li&gt;
&lt;li&gt;Write the Below controls in the .aspx source Page.&lt;/li&gt;
&lt;li&gt;Create an xml file on the desktop with Name Students ( See example xml at the End)&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #b6d7a8;&quot;&gt;&amp;lt;asp:GridView ID=&quot;gvList&quot; runat=&quot;server&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #b6d7a8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/asp:GridView&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #b6d7a8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Path:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #b6d7a8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:FileUpload ID=&quot;FileUpload1&quot; runat=&quot;server&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #b6d7a8;&quot;&gt;&amp;lt;asp:Button ID=&quot;btnAdd&quot; runat=&quot;server&quot; Text=&quot;Add&quot; onclick=&quot;btnAdd_Click&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Write the Below code in the Code behind file&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;using System;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;using System.Collections.Generic;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;using System.Web;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;using System.Web.UI;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;using System.Xml;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;public partial class XMLSample : System.Web.UI.Page&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void btnAdd_Click(object sender, EventArgs e)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HttpPostedFile hpf=FileUpload1.PostedFile;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string fName=FileUpload1.PostedFile.FileName;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.Data.DataSet ds = new System.Data.DataSet();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds.ReadXml(fName);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvList.DataSource = ds.Tables[0];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvList.DataBind();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #a2c4c9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;b&gt;Note&lt;/b&gt; &lt;/span&gt;&lt;/span&gt;: Example Xml file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&lt;students&gt;&lt;/students&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&amp;lt;Students&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&amp;nbsp; &amp;lt;Student&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;id&amp;gt;1312&amp;lt;/id&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;123&amp;lt;/name&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;age&amp;gt;123123&amp;lt;/age&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&amp;nbsp; &amp;lt;/Student&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&amp;nbsp; &amp;lt;Student&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;id&amp;gt;6&amp;lt;/id&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;Ashoke&amp;lt;/name&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;age&amp;gt;23&amp;lt;/age&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&amp;nbsp; &amp;lt;/Student&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #93c47d; color: white;&quot;&gt;&amp;lt;/Students&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #6aa84f;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/8859649470947086409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/8859649470947086409?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/8859649470947086409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/8859649470947086409'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/07/how-to-show-xml-data-in-grid-view.html' title='How to show XML Data in the Grid View'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-4125432467168129642</id><published>2011-07-15T17:58:00.000+05:30</published><updated>2011-07-17T20:45:03.741+05:30</updated><title type='text'>Encrpt and Decrypt Connection String</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;For Security reasons we need to encrypt the connection strings.&lt;/div&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;How to Encrypt a connection string:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Open visual studio command prompt.&lt;/li&gt;
&lt;li&gt;Change your command prompt location and should point to your application physical drive&lt;/li&gt;
&lt;li&gt;Assume your application Name is DataSet and &amp;nbsp;is present in c:\Documents and Settings\Administrator\My Documents&lt;/li&gt;
&lt;li&gt;type the below statements and then press enter to encrypt the connection&lt;/li&gt;
&lt;li&gt;aspnet_regiis -pe &quot;connectionStrings&quot; -app &quot;/DataSet&quot;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;How to Decrypt Connection:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Type the below command and press enter&lt;/li&gt;
&lt;li&gt;aspnet_regiis -pd &quot;connectionStrings&quot; -app &quot;/DataSet&quot;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Note : See the below attached screen shot.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0oP9rpP4rCQfeEuKuSQgaLNUbJe069pXRrvhYGYTUoTExuQjyKQUAbTyg2mes9E09XjF9PtYFqCXdTj6M4ePd4vWnUKU5c498maObf-gNuvQNSaVosmEB0WDiGt0qS_dCDWlYjbm4_G8/s1600/Encrypt+Connection.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;90&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0oP9rpP4rCQfeEuKuSQgaLNUbJe069pXRrvhYGYTUoTExuQjyKQUAbTyg2mes9E09XjF9PtYFqCXdTj6M4ePd4vWnUKU5c498maObf-gNuvQNSaVosmEB0WDiGt0qS_dCDWlYjbm4_G8/s320/Encrypt+Connection.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/4125432467168129642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/4125432467168129642?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/4125432467168129642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/4125432467168129642'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/07/for-security-reasons-we-need-to-encrypt.html' title='Encrpt and Decrypt Connection String'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0oP9rpP4rCQfeEuKuSQgaLNUbJe069pXRrvhYGYTUoTExuQjyKQUAbTyg2mes9E09XjF9PtYFqCXdTj6M4ePd4vWnUKU5c498maObf-gNuvQNSaVosmEB0WDiGt0qS_dCDWlYjbm4_G8/s72-c/Encrypt+Connection.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-857416878050181935</id><published>2011-07-09T17:27:00.000+05:30</published><updated>2011-07-09T17:34:13.204+05:30</updated><title type='text'>Sealed class</title><content type='html'>&lt;div style=&quot;mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .75pt;padding:0cm 0cm 1.0pt 0cm&quot;&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;border:none;mso-border-bottom-alt:solid windowtext .75pt; padding:0cm;mso-padding-alt:0cm 0cm 1.0pt 0cm&quot;&gt;Sealed class&lt;/p&gt;  &lt;/div&gt;  &lt;p class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;text-indent:-18.0pt;mso-list:l0 level1 lfo1&quot;&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin&quot;&gt;&lt;span style=&quot;mso-list:Ignore&quot;&gt;&lt;span style=&quot;font:7.0pt &amp;quot;Times New Roman&amp;quot;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;It is complete class&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin&quot;&gt;&lt;span style=&quot;mso-list:Ignore&quot;&gt;&lt;span style=&quot;font:7.0pt &amp;quot;Times New Roman&amp;quot;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;It is allow creating an object&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin&quot;&gt;&lt;span style=&quot;mso-list:Ignore&quot;&gt;&lt;span style=&quot;font:7.0pt &amp;quot;Times New Roman&amp;quot;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;It is also called instance class&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin&quot;&gt;&lt;span style=&quot;mso-list:Ignore&quot;&gt;&lt;span style=&quot;font:7.0pt &amp;quot;Times New Roman&amp;quot;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Inheritance is not possible for Sealed Class. Means No one can be able to inherit from a Sealed Class but sealed class can inherit from any other class (The Parent Class should not be Sealed Class).&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin&quot;&gt;&lt;span style=&quot;mso-list:Ignore&quot;&gt;&lt;span style=&quot;font:7.0pt &amp;quot;Times New Roman&amp;quot;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Sealed class can never acts as a Parent Class&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin&quot;&gt;&lt;span style=&quot;mso-list:Ignore&quot;&gt;&lt;span style=&quot;font:7.0pt &amp;quot;Times New Roman&amp;quot;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Static class is by default sealed class only.&lt;/li&gt;&lt;/ol&gt;&lt;!--[if !supportLists]--&gt;&lt;p&gt;&lt;/p&gt;            &lt;p class=&quot;MsoNormal&quot;&gt;Example for Sealed Class:&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;----------------------------------------------------&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;­­­­&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:blue&quot;&gt;sealed&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color:#2B91AF&quot;&gt;ToyCalc&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:blue&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color:#2B91AF&quot;&gt;AdvancedToyCalc&lt;/span&gt; : ToyCalc&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size:10.0pt;line-height:115%;font-family: &amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;Note 1:&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;The above Code is wrong since a sealed class can never act as a Base or Parent Class.&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;Note 2: &lt;span style=&quot;mso-spacerun:yes&quot;&gt; &lt;/span&gt;But &lt;span style=&quot;font-size:10.0pt;line-height:115%;font-family:&amp;quot;Courier New&amp;quot;;color:#2B91AF; mso-no-proof:yes&quot;&gt;ToyCalc &lt;/span&gt;class can inherit from other classes ex.&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;Ex: ­­­­&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:blue&quot;&gt;sealed&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color:#2B91AF&quot;&gt;ToyCalc: Toy&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:#2B91AF;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:#2B91AF;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;&lt;/span&gt;The Toy Class should not be a Static Class or SealedClass.&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/857416878050181935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/857416878050181935?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/857416878050181935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/857416878050181935'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/07/sealed-class.html' title='Sealed class'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-3255877733006047338</id><published>2011-07-09T17:11:00.000+05:30</published><updated>2011-07-09T17:22:10.727+05:30</updated><title type='text'>Abstract Class</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 51, 255); &quot;&gt;&lt;b&gt;Abstract Class:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;When a class is not providing full functionality it recommended to declare that class as an Abstract class.&lt;/li&gt;&lt;li&gt;Method with out body is called an abstract method.&lt;/li&gt;&lt;li&gt;Ex: public abstract void GetArea ();&lt;/li&gt;&lt;li&gt;When class contain at least one abstract method then that class must be declared as abstract class.&lt;/li&gt;&lt;li&gt;All the abstract method must be overridden in the derived class.&lt;/li&gt;&lt;li&gt;We cant create object for  Abstract class.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Ex :&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; System.Collections.Generic;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; System.Linq;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; System.Web;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; System.Web.UI;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; System.Web.UI.WebControls;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:blue&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color:#2B91AF&quot;&gt;AbstractClassSammple&lt;/span&gt; : System.Web.UI.&lt;span style=&quot;color:#2B91AF&quot;&gt;Page&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span style=&quot;color:blue&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color:#2B91AF&quot;&gt;EventArgs&lt;/span&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;         &lt;/span&gt;&lt;span style=&quot;color:#2B91AF&quot;&gt;Circle&lt;/span&gt; c = &lt;span style=&quot;color:blue&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color:#2B91AF&quot;&gt;Circle&lt;/span&gt; ();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;            &lt;/span&gt;c.print();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;            &lt;/span&gt;Response.Write(c.findarea()+&lt;span style=&quot;color:#A31515&quot;&gt;&quot;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;   &lt;/span&gt;&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;            &lt;/span&gt;Response.Write(&lt;span style=&quot;color:#A31515&quot;&gt;&quot;&lt;br /&gt;&quot;&lt;/span&gt;+c.print()); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;           &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;public abstract&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:blue&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color:#2B91AF&quot;&gt;Shape&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;int&lt;/span&gt; x = 10;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;int&lt;/span&gt; y = 20;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;int&lt;/span&gt; print()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;return&lt;/span&gt; (x + y);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;     &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;}&lt;span style=&quot;mso-spacerun:yes&quot;&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;abstract&lt;/span&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;double&lt;/span&gt; findarea(); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;public class&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:#2B91AF&quot;&gt;Circle&lt;/span&gt; : &lt;span style=&quot;color:#2B91AF&quot;&gt;Shape&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;int&lt;/span&gt; r = 10;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;override&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;double&lt;/span&gt; findarea()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;double&lt;/span&gt; a = 3.14 * r * r;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;return&lt;/span&gt; (a);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;} &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size:10.0pt;line-height:115%;font-family: &amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/3255877733006047338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/3255877733006047338?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/3255877733006047338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/3255877733006047338'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/07/abstract-class.html' title='Abstract Class'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-841310421086326715</id><published>2011-06-08T22:24:00.000+05:30</published><updated>2011-06-08T22:24:51.101+05:30</updated><title type='text'>Important JavaScript Methods</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;The &amp;nbsp;below JavaScript methods are very much useful while writing JavaScript Code.&lt;br /&gt;
Note: Below Questions are&amp;nbsp;Frequently&amp;nbsp;asked in .NET Interviews&lt;br /&gt;
1.document.getElementById(&quot;ControlID&quot;);&lt;br /&gt;
2.document.getElementByName(&quot;Control Name&quot;);&lt;br /&gt;
&lt;br /&gt;
Dom Properties:&lt;br /&gt;
&lt;br /&gt;
the below properties are the freequently used properties while writing JavaScript Code.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;z.innerHTML - the text value of z&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;z.nodeName - the name of z&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;z.nodeValue - the value of z&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;z.parentNode - the parent node of z&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;z.childNodes - the child nodes of z&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;z.attributes - the attributes nodes of z&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;Note: z Represents HTMLElement ( ex.&amp;nbsp;Text Box&amp;nbsp;or Radio Button )&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/841310421086326715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/841310421086326715?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/841310421086326715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/841310421086326715'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/06/important-javascript-methods.html' title='Important JavaScript Methods'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-6026920908942053838</id><published>2011-05-18T18:09:00.000+05:30</published><updated>2011-05-18T18:09:05.204+05:30</updated><title type='text'>Why .NET is better than Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;There are couple things we need to understand before comparing Java and .NET.&lt;br /&gt;
&lt;br /&gt;
1.Usually softwares are developed to automate any business and to reduce human intervention.&lt;br /&gt;
2.Let us Say Palle Technologies wanted to develop a software for XYZ hospital. Since XYZ hospital wanted to automate the Registration,Admission,Scheduling etc process and they decided to develop a software which makes their daily work faster and increases Revenue.&lt;br /&gt;
3.They gave contract of developing an application to PalleTechnologiies and asked to come with feasible choice of softwares and they gave us 6 months time for development for what ever the technology they choose.&lt;br /&gt;
4.We analysed the requirement and estimated development and maintainence effort for Both Java and .NET&lt;br /&gt;
5. We saw significant notable differences between JAVA and .NET&lt;br /&gt;
Note: Assumed Application Life time = 15 years.&lt;br /&gt;
&amp;nbsp;Look at the Estimated Costs Required for creating the application for XYZ company.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;b&gt;Estimation for Java Application :&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; Java Total Resources Required for Development (6 months)= 6 resources&lt;br /&gt;
&amp;nbsp; Cost of Each Resource= 6* 20000 INR/Month&lt;br /&gt;
&amp;nbsp;Total Resources Cost During Development=720000 INR&lt;br /&gt;
Note: We assumed XYZ company is going to use this software for 15 years&lt;br /&gt;
Cost of Maintaining the Application for 1 year =3*20000 INR/Person/Month*12 Months=720000&lt;br /&gt;
Cost of Maintaining the Application for 15 years=10800000 INR.&lt;br /&gt;
Cost of Softwares and Servers = 60000 INR.&lt;br /&gt;
Total Cost=11580000 INR.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;b&gt;Estimation for .NET Application :&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: black; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;&amp;nbsp;.NET Total Resources Required for Development (6 months)= 5 resources&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;&amp;nbsp; Cost of Each Resource= 5* 20000 INR/Month&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;&amp;nbsp;Total Resources Cost During Development=700000 INR&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;Note: We assumed XYZ company is going to use this software for 15 years&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;Cost of Maintaining the Application for 1 year with 2 Resources=2*20000 INR/Person/Month*12 Months=480000&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;Cost of Maintaining the Application for 15 years=7200000 INR.&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;Cost of Softwares and Servers = 100000 INR.&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;Total Cost=8000000 INR.&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6aa84f;&quot;&gt;We found significant difference of almost 30 lakhs of rupees savings to XYZ company if They Choose .NET.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/6026920908942053838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/6026920908942053838?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/6026920908942053838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/6026920908942053838'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/05/why-net-is-better-than-java.html' title='Why .NET is better than Java'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-8086818038595382649</id><published>2011-04-06T07:57:00.000+05:30</published><updated>2011-04-06T07:57:54.573+05:30</updated><title type='text'>AutoEventWireUp</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;AutoEventWireUp attribute in asp.net is used to call the Page_Load and Page_InIt methods automatically&lt;br /&gt;
by setting AutoEventWireUp=true;&lt;br /&gt;
By default AutoEventWireup set to true in machine.config and hence at the page level it is set to false&lt;br /&gt;
If you set AutoEventWireUp=true at page level then Page_Load and Page_InIt will be executed twice.&lt;br /&gt;
&lt;br /&gt;
Sign up for &lt;a href=&quot;http://techpalle.com/net-training-in-bangalore.html&quot;&gt;.Net Training Bangalore&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/8086818038595382649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/8086818038595382649?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/8086818038595382649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/8086818038595382649'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/04/autoeventwireup.html' title='AutoEventWireUp'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-4990512673490400983</id><published>2011-04-06T07:49:00.000+05:30</published><updated>2011-04-06T07:49:30.584+05:30</updated><title type='text'>User Control assignment ( Change Button color from User Control Text Box Value)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;1.Create User Control with name Enquiry . Drag and drop Text box control on the Enquiry.ascx&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;set text box id=&quot;tbColorName&quot;.&lt;br /&gt;
2.Create a property in the Enquiry.ascx.cs as shown below.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;private string _color;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;public string Color&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;get { return _color; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set { _color = value; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
3.Create a Page with Name UserControlSample.aspx and do below given activities&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Drag and drop a button on the aspx page and set id=&quot;btnSubmit&quot; Text=&quot;Submit&quot;&lt;/li&gt;
&lt;li&gt;Drag and drop the User Control on to the surface of the aspx page. Set UserControl id=&quot;Enquiry1&quot;.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;4.Write the below code in the&amp;nbsp;UserControlSample.aspx.cs&lt;/div&gt;&lt;div&gt;&lt;div&gt;protected void btnSubmit_Click(object sender, EventArgs e)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (var c in Enquiry1.Controls)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Type t=c.GetType();&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (t.Name==&quot;TextBox&quot;)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Enquiry1.Color = ((TextBox)c).Text;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;btnSubmit.BackColor = System.Drawing.Color.FromName(Enquiry1.Color);&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;5.Execute the application by pressing F5.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/4990512673490400983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/4990512673490400983?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/4990512673490400983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/4990512673490400983'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/04/user-control-assignment-change-button.html' title='User Control assignment ( Change Button color from User Control Text Box Value)'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-1913180135492385452</id><published>2011-03-31T23:25:00.000+05:30</published><updated>2011-03-31T23:41:44.291+05:30</updated><title type='text'>JavaScript Validations</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;Default.aspx Page Start&lt;/span&gt;&lt;br /&gt;
&amp;lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot;  CodeFile=&quot;Default.aspx.cs&quot; Inherits=&quot;_Default&quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head runat=&quot;server&quot;&amp;gt;&lt;br /&gt;
&amp;lt;title&amp;gt;Registration Form&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;
function fnValidate()&lt;br /&gt;
{&lt;br /&gt;
//FName Validation.&lt;br /&gt;
fnValidateFirstName();&lt;br /&gt;
//LName Validation&lt;br /&gt;
fnValidateLastName();&lt;br /&gt;
//Mobile validation&lt;br /&gt;
fnValidateMobileNumber();&lt;br /&gt;
//PEmail validation&lt;br /&gt;
fnValidatePrimaryEmail();&lt;br /&gt;
//SEmail Validation&lt;br /&gt;
fnValidateSecondaryEmail();&lt;br /&gt;
//Counttry Validation&lt;br /&gt;
fnValidateCountries();&lt;br /&gt;
}&lt;br /&gt;
function fnValidateSecondaryEmail()&lt;br /&gt;
{&lt;br /&gt;
var semail=document.getElementById(&quot;txtsemail&quot;).value;&lt;br /&gt;
var semailregex=/^(?:\w+\.?)*\w+@(?:\w+\.)+\w+$/;&lt;br /&gt;
if(!semail.match(semailregex))&lt;br /&gt;
{&lt;br /&gt;
alert(&quot;enter valid emailid&quot;);&lt;br /&gt;
} &lt;br /&gt;
}&lt;br /&gt;
function fnValidatePrimaryEmail()&lt;br /&gt;
{&lt;br /&gt;
var pemailno=document.getElementById(&quot;txtPemail&quot;).value;&lt;br /&gt;
if(pemailno==&quot;&quot;)&lt;br /&gt;
{&lt;br /&gt;
alert(&quot;email id is mandatory&quot;);&lt;br /&gt;
}&lt;br /&gt;
var pemailregex=/^(?:\w+\.?)*\w+@(?:\w+\.)+\w+$/;&lt;br /&gt;
if(!pemailno.match(pemailregex))&lt;br /&gt;
{&lt;br /&gt;
alert(&quot;enter valid emailid&quot;);&lt;br /&gt;
}  &lt;br /&gt;
}&lt;br /&gt;
function fnValidateMobileNumber()&lt;br /&gt;
{&lt;br /&gt;
var mobile=document.getElementById(&quot;txtMobile&quot;).value;&lt;br /&gt;
if(mobile==&quot;&quot;)&lt;br /&gt;
{&lt;br /&gt;
alert(&quot;Mobile number is mandatory&quot;);&lt;br /&gt;
}&lt;br /&gt;
var mno= /^((\+)?(\d{2}[-]))?(\d{10}){1}?$/;&lt;br /&gt;
if(!mobile.match(mno))&lt;br /&gt;
{&lt;br /&gt;
alert(&quot;1.Mobile Number should Have Only Digits .\n2.Mobile Number should contain 10 digits&quot;);&lt;br /&gt;
return false;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
return true;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
function fnValidateLastName()&lt;br /&gt;
{&lt;br /&gt;
var lname=document.getElementById(&quot;txtlname&quot;).value;&lt;br /&gt;
var alphaExp= /^[a-zA-Z]+$/;&lt;br /&gt;
if(!lname.match(alphaExp))&lt;br /&gt;
{&lt;br /&gt;
alert(&quot;Last name should have only alphabets&quot;);&lt;br /&gt;
return false;&lt;br /&gt;
}&lt;br /&gt;
else &lt;br /&gt;
{&lt;br /&gt;
return true;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
function fnValidateFirstName()&lt;br /&gt;
{&lt;br /&gt;
var fname=document.getElementById(&quot;txtfname&quot;).value;&lt;br /&gt;
if(fname==&quot;&quot;)&lt;br /&gt;
{&lt;br /&gt;
alert(&quot;First Name Cannot be Blank.&quot;);&lt;br /&gt;
return false;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
var alphaExp = /^[a-zA-Z]+$/;&lt;br /&gt;
&lt;br /&gt;
if(!fname.match(alphaExp))&lt;br /&gt;
{&lt;br /&gt;
alert(&quot;First Name should contain Only Alphabets.&quot;);&lt;br /&gt;
return false;&lt;br /&gt;
}&lt;br /&gt;
return true;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
function fnValidateCountries()&lt;br /&gt;
{&lt;br /&gt;
var index=document.getElementById(&quot;ddlCountry&quot;).selectedIndex;&lt;br /&gt;
alert(index);&lt;br /&gt;
if(index==0)&lt;br /&gt;
{&lt;br /&gt;
alert(&quot;Please Select a Country.&quot;);&lt;br /&gt;
return false;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;form id=&quot;form1&quot; runat=&quot;server&quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
&amp;lt;table width=&quot;100%&quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td width=&quot;15%&quot;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td width=&quot;70%&quot;&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&quot;right&quot;&amp;gt;FirstName:&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;asp:TextBox ID=&quot;txtfname&quot; runat=&quot;server&quot; /&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&quot;right&quot;&amp;gt;Mobile:&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;asp:TextBox ID=&quot;txtMobile&quot; runat=&quot;server&quot; /&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&quot;right&quot;&amp;gt;LastName:&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;asp:TextBox ID=&quot;txtlname&quot; runat=&quot;server&quot; /&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&quot;right&quot;&amp;gt;Phone:&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;asp:TextBox Width=&quot;10%&quot; ID=&quot;tbCountryCode&quot; runat=&quot;server&quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;asp:TextBox Width=&quot;10%&quot; ID=&quot;tbCityCode&quot; runat=&quot;server&quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;asp:TextBox Width=&quot;29%&quot; ID=&quot;tbPhone&quot; runat=&quot;server&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&quot;right&quot;&amp;gt;PrimaryMail: &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &lt;br /&gt;
&amp;lt;asp:TextBox ID=&quot;txtPemail&quot; runat=&quot;server&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&quot;right&quot;&amp;gt;SecondaryMail:&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;asp:TextBox ID=&quot;txtsemail&quot; runat=&quot;server&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&quot;right&quot;&amp;gt;Address1:&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;asp:TextBox ID=&quot;txtaddress1&quot; runat=&quot;server&quot; TextMode=&quot;MultiLine&quot; rows=&quot;5&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Country:&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;asp:DropDownList ID=&quot;ddlCountry&quot; runat=&quot;server&quot;&lt;br /&gt;
width=&quot;80%&quot;&amp;gt;&amp;lt;/asp:DropDownList&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;asp:Button ID=&quot;btnSubmit&quot; runat=&quot;server&quot; Text=&quot;Submit&quot; &lt;br /&gt;
OnClientClick=&quot;return fnValidate()&quot; /&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td width=&quot;15%&quot;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;Default.aspx Page End&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;Default.aspx.cs Page Start&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Configuration;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Linq;&lt;br /&gt;
using System.Web;&lt;br /&gt;
using System.Web.Security;&lt;br /&gt;
using System.Web.UI;&lt;br /&gt;
using System.Web.UI.HtmlControls;&lt;br /&gt;
using System.Web.UI.WebControls;&lt;br /&gt;
using System.Web.UI.WebControls.WebParts;&lt;br /&gt;
using System.Xml.Linq;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
&lt;br /&gt;
public partial class _Default : System.Web.UI.Page&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (!IsPostBack)&lt;br /&gt;
&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;FillCountries();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;private void FillCountries()&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ArrayList alCountries = new ArrayList();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alCountries.Add(&quot;India&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alCountries.Add(&quot;Pakistan&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alCountries.Add(&quot;Srilanka&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alCountries.Add(&quot;Australia&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ddlCountry.DataSource = alCountries;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ddlCountry.DataBind();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ddlCountry.Items.Insert(0, &quot;--Select--&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;div style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;Default.aspx.cs Page End&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/1913180135492385452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/1913180135492385452?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/1913180135492385452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/1913180135492385452'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/03/javascript-validations.html' title='JavaScript Validations'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-7512413446577718136</id><published>2011-03-17T20:41:00.000+05:30</published><updated>2011-06-08T22:08:19.324+05:30</updated><title type='text'>What is JavaScript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;JavaScript is a Scripting language , The&amp;nbsp;JavaScript(js)&amp;nbsp;code will be executed by the JavaScript engine which comes with the Browser ( I.E,Opera,Mozilla etc..)&lt;/li&gt;
&lt;li&gt;JavaScript is a loosely typed language and is called client side scripting language. Because the js code you have written in the .aspx &amp;nbsp;pages will be sent back to client browser by the&amp;nbsp;web server&amp;nbsp;(IIS) and the JavaScript code will be executed by Browser hence we call this as Client side Script.&lt;/li&gt;
&lt;li&gt;The Html and js code sent by IIS to browser will be executed by HTML parser and JavaScript engine which are present in the Browser software ( Browser like IE,Opera, Chrome all are softwares which contains code written in c-language etc..)&lt;/li&gt;
&lt;li&gt;Note: For&amp;nbsp;&lt;a href=&quot;http://techpalle.com/net-training-in-bangalore.html&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;.net training institutes in Bangalore&lt;/span&gt;&lt;/a&gt; you can always visit&amp;nbsp;&lt;a href=&quot;http://techpalle.com/net-training-in-bangalore.html&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;http://techpalle.com/net-training-in-bangalore.html&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/7512413446577718136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/7512413446577718136?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/7512413446577718136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/7512413446577718136'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2011/03/what-is-javascript.html' title='What is JavaScript'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-1769729581386121681</id><published>2010-12-28T17:38:00.000+05:30</published><updated>2011-02-27T15:53:57.715+05:30</updated><title type='text'>Serialization and De-Serialization Example</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Create a webapplication(asp.net application ) using visual studio. Now create the below class&lt;br /&gt;
[Serializable]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public class patient&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static patient p;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private int _age;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int Age&lt;br /&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;&amp;nbsp; get&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;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _age;&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;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&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;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; _age = value;&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;br /&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; private patient()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&lt;br /&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; public static patient getPatientObject()&lt;br /&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;&amp;nbsp; if (p == null)&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;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; p = new patient(); return p;&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;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&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;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; return p;&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;br /&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; public static void SerializeToXML()&lt;br /&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;&amp;nbsp; //Note: XmlSerializer is a Protected class&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; patient pat = new patient();&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; XmlSerializer serializer = new XmlSerializer(typeof(patient));&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; TextWriter textWriter = new StreamWriter(@&quot;C:\serializedpatient.xml&quot;);&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; serializer.Serialize(textWriter, pat);&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; textWriter.Close();&lt;br /&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; public static patient DeserializeFromXml()&lt;br /&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;&amp;nbsp; TextReader tr=new StreamReader(@&quot;c:\serializedpatient.xml&quot;);&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; XmlSerializer serializer = new XmlSerializer(typeof(patient));&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; patient p=(patient)serializer.Deserialize(tr);&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; return p;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
Next Steps: 1. Now Create a .aspx page with name SerializationSample.aspx &lt;br /&gt;
2.Create 2 Buttons with name Serialize( button id=btnSerialize) De-Serialize ( button id=btnDeserialize)&lt;br /&gt;
3.Create handlers for these two buttons. Call the methods &quot;patient.SerializeToXML(); &quot; and &quot;patient.DeserializeFromXml();&quot; from the clickeventhandler methods btnSerialize_click,btnDeserialize_click respectively.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;For Best Android Training Click Here:&lt;/b&gt;&lt;/span&gt;&lt;a href=&quot;http://techpalle.com/android-training-in-bangalore.html&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;Android training in Bangalore&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/1769729581386121681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/1769729581386121681?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/1769729581386121681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/1769729581386121681'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2010/12/serialization-and-de-serialization.html' title='Serialization and De-Serialization Example'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4910281762726240897.post-5791924647117683949</id><published>2010-12-23T18:04:00.000+05:30</published><updated>2011-04-06T18:57:34.865+05:30</updated><title type='text'>what is Serialization and when to do it?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Student: What is Serialization?&lt;br /&gt;
TechPalle: Serialization is the process of converting an object into a stream. stream can be xml stream or it can be a byte stream.&lt;br /&gt;
Student: Why should i do Serialization?&lt;br /&gt;
TechPalle: Serialization is required many times in Real time programming.&lt;br /&gt;
Below are the examples of when to use Serialization.&lt;br /&gt;
Ex 1: In the 3-tier architecture let us say we have BAL,DAL and UI layer. Now assume these projects deployed in three different machines. now i want to get an object of some class from one tier to other tier or application in another computer. So if you want to send objects from one computer to another , you cannot transfer the object in its original form . But you need to convert the object into some form of stream and then send the stream to another computer. Now after receiving the stream then get the object back by DE-serializing the object back from the stream. This is the common situation where you have to do Serialization and De-Serialization. See complete example of Serialization and De serialization in the next article.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettution.blogspot.com/feeds/5791924647117683949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4910281762726240897/5791924647117683949?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/5791924647117683949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4910281762726240897/posts/default/5791924647117683949'/><link rel='alternate' type='text/html' href='http://dotnettution.blogspot.com/2010/12/importence-of-serialization.html' title='what is Serialization and when to do it?'/><author><name>Lok</name><uri>http://www.blogger.com/profile/11128618656143109030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>