<?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-6071830986390841423</id><updated>2024-09-16T20:39:54.694-07:00</updated><category term="CRYPTOGRAPHY"/><category term="Connected and disconnected architecture in ADO.Net with Example (Disconnected architecture in asp.net)"/><category term="Difference between DLL and Assembly"/><category term="Inheritance source code"/><category term="Insert Data in Connected Architecture"/><category term="InterFace"/><category term="Method OverRiding"/><category term="Sending Mail in C# Asp.net"/><category term="Storing and Retrieving Image from Database in C# Asp.Net"/><category term="code to insert data in disconnected in asp.net"/><category term="connected and disconnected architecture in ASP.Net"/><category term="sql stored procedure Add Operation"/><title type='text'>Connected and disconnected architecture in ADO.Net with Example(ASP.Net Sample Source Codes) </title><subtitle type='html'>ASP.Net Sample Codes for Freshers</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6071830986390841423.post-3665772005630618041</id><published>2012-02-15T02:06:00.001-08:00</published><updated>2013-07-28T04:50:17.562-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Storing and Retrieving Image from Database in C# Asp.Net"/><title type='text'>Storing and Retrieving Image from Database in C# Asp.Net</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;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&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/AVvXsEiN3WfFd7wuZQ11Squek9rGnWIuiEtLlRirbaFcd8b6QRLygUU3IjyBFEP5qQKCUdOLRaxVxyisqrKlAuYeP0bgFYdd6HHVjTgu_yIyDfsLRaEMaehoYyreIO1Ezw3xubeWE7llY7k0nJg/s1600/StoreImage1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;307&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN3WfFd7wuZQ11Squek9rGnWIuiEtLlRirbaFcd8b6QRLygUU3IjyBFEP5qQKCUdOLRaxVxyisqrKlAuYeP0bgFYdd6HHVjTgu_yIyDfsLRaEMaehoYyreIO1Ezw3xubeWE7llY7k0nJg/s320/StoreImage1.JPG&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Storing and Retrieving Image from Database&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Write Below code in Default Page &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Configuration;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Data;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Web;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Web.Security;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Web.UI;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Web.UI.HtmlControls;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Web.UI.WebControls.WebParts;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Xml.Linq;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Data.SqlClient;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;public partial class _Default : System.Web.UI.Page&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlConnection connection = new SqlConnection(&quot;data source=.; Initial catalog=LoadPhoto;integrated security=sspi;&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void btnSubmit_Click(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FileUpload img = (FileUpload)imgUpload;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Byte[] imgByte = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (img.HasFile &amp;amp;&amp;amp; img.PostedFile != null)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //To create a PostedFile&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HttpPostedFile File = imgUpload.PostedFile;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Create byte Array with file len&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; imgByte = new Byte[File.ContentLength];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //force the control to load data in array&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; File.InputStream.Read(imgByte, 0, File.ContentLength);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Insert the employee name and image into db&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //string conn = ConfigurationManager.ConnectionStrings[&quot;EmployeeConnString&quot;].ConnectionString;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //connection = new SqlConnection(conn);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; connection.Open();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string sql = &quot;INSERT INTO EmpDetails(empname,empimg) VALUES(@enm, @eimg) SELECT @@IDENTITY&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmd = new SqlCommand(sql, connection);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters.AddWithValue(&quot;@enm&quot;, txtEName.Text.Trim());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters.AddWithValue(&quot;@eimg&quot;, imgByte);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int id = Convert.ToInt32(cmd.ExecuteScalar());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lblResult.Text = String.Format(&quot;Employee ID is {0}&quot;, id);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Image1.ImageUrl = &quot;~/ShowImage.ashx?id=&quot; + id;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lblResult.Text = &quot;Photo Size should be less than 20 KB&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finally&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; connection.Close();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;////////////////////////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Write the below code in &amp;nbsp;ShowImage.ashx file&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&amp;lt;%@ WebHandler Language=&quot;C#&quot; Class=&quot;ShowImage&quot; %&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
using System;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Configuration;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Web;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.IO;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Data;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Data.SqlClient;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
public class ShowImage : IHttpHandler&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlConnection connection = new SqlConnection(&quot;data source=.; Initial catalog=LoadPhoto;integrated security=sspi;&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; public void ProcessRequest(HttpContext context)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Int32 empno;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (context.Request.QueryString[&quot;id&quot;] != null)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; empno = Convert.ToInt32(context.Request.QueryString[&quot;id&quot;]);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw new ArgumentException(&quot;No parameter specified&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;context.Response.ContentType = &quot;image/jpeg&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Stream strm = ShowEmpImage(empno);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byte[] buffer = new byte[4096];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int byteSeq = strm.Read(buffer, 0, 4096);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while (byteSeq &amp;gt; 0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;context.Response.OutputStream.Write(buffer, 0, byteSeq);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byteSeq = strm.Read(buffer, 0, 4096);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//context.Response.BinaryWrite(buffer);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public Stream ShowEmpImage(int empno)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;//string conn = ConfigurationManager.ConnectionStrings &amp;nbsp; &amp;nbsp; [&quot;EmployeeConnString&quot;].ConnectionString;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //SqlConnection connection = new SqlConnection(conn);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string sql = &quot;SELECT empimg FROM EmpDetails WHERE empid = @ID&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmd = new SqlCommand(sql,connection);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.CommandType = CommandType.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters.AddWithValue(&quot;@ID&quot;, empno);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; connection.Open();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; object img = cmd.ExecuteScalar();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new MemoryStream((byte[])img);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finally&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; connection.Close();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public bool IsReusable&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; get&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/3665772005630618041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2012/02/storing-and-retrieving-image-from.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/3665772005630618041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/3665772005630618041'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2012/02/storing-and-retrieving-image-from.html' title='Storing and Retrieving Image from Database in C# Asp.Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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/AVvXsEiN3WfFd7wuZQ11Squek9rGnWIuiEtLlRirbaFcd8b6QRLygUU3IjyBFEP5qQKCUdOLRaxVxyisqrKlAuYeP0bgFYdd6HHVjTgu_yIyDfsLRaEMaehoYyreIO1Ezw3xubeWE7llY7k0nJg/s72-c/StoreImage1.JPG" height="72" width="72"/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6071830986390841423.post-4325130049851500177</id><published>2012-02-02T22:36:00.001-08:00</published><updated>2012-02-02T22:36:44.723-08:00</updated><title type='text'>InterFace</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;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;using System;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;using System.Collections.Generic;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;using System.Text;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;interface ICalculate&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; void IADD();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; void ISUB();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;class Calculate : ICalculate /////////Child class Calculate Inherited Interface ICalculate&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; #region ICalculate Members&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; public void IADD()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //throw new System.NotImplementedException();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int x, y, z;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Enter values for x and y&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = int.Parse(Console.ReadLine());&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y = Convert.ToInt32(Console.ReadLine());&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; z = x + y;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Addition of x and y is: &quot; + z);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; public void ISUB()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// throw new System.NotImplementedException();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int x, y, r;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Enter values for x and y&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = int.Parse(Console.ReadLine());&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y = Convert.ToInt32(Console.ReadLine());&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;r = x - y;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Subtraction of x and y is: &quot; +r);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp;#endregion&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;using System;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;using System.Collections.Generic;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;using System.Text;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;namespace Interface&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; class Program&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;An interface looks like a class, but has no implementation. The only thing it contains are declarations of events, indexers, methods and/or properties. The reason interfaces only provide declarations is because they are inherited by classes and structs, which must provide an implementation for each interface member declared.&quot;);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;C# does not support multiple inheritence to overcome these problems we use interfaces. This is main use of Interfaces we have in C#.&quot;);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Interfaces are a very logical way of grouping objects in terms of behavior. &quot;);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ICalculate obj = new Calculate();/////Instance ie representative of Interface and Abstract class cannot be created&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /////ICalculate obj = new ICalculate();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ////// object of interface is a representative of Class Calculate&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ////// Break Point cannot be allocated for interface for debugging.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.IADD();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.ISUB();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Console.WriteLine(&quot;Division of 2 nos is&quot;);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Console.WriteLine(&quot;&quot; + obj.IDIV(10,2));&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/4325130049851500177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2012/02/interface_02.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/4325130049851500177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/4325130049851500177'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2012/02/interface_02.html' title='InterFace'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-6469912335680926500</id><published>2012-02-02T22:32:00.000-08:00</published><updated>2013-07-28T04:53:50.050-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="InterFace"/><title type='text'>InterFace</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;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Collections.Generic;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Text;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;interface ICalculate&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; void IADD();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; void ISUB();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;class Calculate : ICalculate /////////Child class Calculate Inherited Interface ICalculate&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; #region ICalculate Members&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; public void IADD()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //throw new System.NotImplementedException();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int x, y, z;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Enter values for x and y&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = int.Parse(Console.ReadLine());&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y = Convert.ToInt32(Console.ReadLine());&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; z = x + y;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Addition of x and y is: &quot; + z);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; public void ISUB()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// throw new System.NotImplementedException();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int x, y, r;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Enter values for x and y&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = int.Parse(Console.ReadLine());&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y = Convert.ToInt32(Console.ReadLine());&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;r = x - y;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Subtraction of x and y is: &quot; +r);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;#endregion&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Collections.Generic;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Text;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;namespace Interface&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; class Program&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;An interface looks like a class, but has no implementation. The only thing it contains are declarations of events, indexers, methods and/or properties. The reason interfaces only provide declarations is because they are inherited by classes and structs, which must provide an implementation for each interface member declared.&quot;);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;C# does not support multiple inheritence to overcome these problems we use interfaces. This is main use of Interfaces we have in C#.&quot;);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Interfaces are a very logical way of grouping objects in terms of behavior. &quot;);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ICalculate obj = new Calculate();/////Instance ie representative of Interface and Abstract class cannot be created&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /////ICalculate obj = new ICalculate();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ////// object of interface is a representative of Class Calculate&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ////// Break Point cannot be allocated for interface for debugging.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.IADD();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.ISUB();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Console.WriteLine(&quot;Division of 2 nos is&quot;);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Console.WriteLine(&quot;&quot; + obj.IDIV(10,2));&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/6469912335680926500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2012/02/interface.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/6469912335680926500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/6469912335680926500'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2012/02/interface.html' title='InterFace'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-2293371593510175432</id><published>2012-02-02T22:29:00.001-08:00</published><updated>2013-07-28T04:47:36.245-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Method OverRiding"/><title type='text'>Method OverRiding</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;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Collections.Generic;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Text;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;namespace MethodOverriding1&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; //sealed class M&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; //{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public class Base&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public virtual void Test(int a, int b)//&quot;Virtual Keyword&quot; is used when u need to&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//override same Method called as Test in Child Class.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int c;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c = a + b;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.Console.WriteLine(&quot;Add is: &quot; + c);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public class Child : Base&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public override void Test(int a, int b)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int c;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c = a * b;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.Console.WriteLine(&quot;Multiplication is: &quot; + c);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public class Child1 : Base&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public override void Test(int a, int b)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int c;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c = a / b;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.Console.WriteLine(&quot;Division is: &quot; + c);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static public void Main()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Base B = new Base();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Child c = new Child();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Child1 d = new Child1();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B.Test(10, 20);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c.Test(30, 40);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; d.Test(20, 5);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;//}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/2293371593510175432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2012/02/method-overriding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/2293371593510175432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/2293371593510175432'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2012/02/method-overriding.html' title='Method OverRiding'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-9181339889541600371</id><published>2011-11-08T06:02:00.000-08:00</published><updated>2013-07-28T04:44:45.936-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sending Mail in C# Asp.net"/><title type='text'>Sending Mail in C# 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;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: large;&quot;&gt;Sending Mail in C# Asp.net&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;using System;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;using System.Collections.Generic;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;using System.Web;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;using System.Web.UI;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;public partial class _Default : System.Web.UI.Page&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void BtnSend_Click(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.Net.Mail.MailMessage obj = new System.Net.Mail.MailMessage();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.From = new System.Net.Mail.MailAddress(TxtFrm.Text);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (TxtTo.Text.Contains(&quot;,&quot;))&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string[] to = TxtTo.Text.Split(&#39;,&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (string r in to)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.To.Add(new System.Net.Mail.MailAddress(r));&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.To.Add(new System.Net.Mail.MailAddress(TxtTo.Text));&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.CC.Add(new System.Net.Mail.MailAddress(TxtCc.Text));&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.Bcc.Add(new System.Net.Mail.MailAddress(TxtBCc.Text));&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.Subject = TxtSub.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.IsBodyHtml = true;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.Net.Mail.Attachment att = new System.Net.Mail.Attachment(FileUpload1.PostedFile.InputStream,FileUpload1.PostedFile.FileName,FileUpload1.PostedFile.ContentType);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.Attachments.Add(att);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.Body = Txtbdy.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(&quot;1.0.0.0&quot;, 25);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; smtp.Send(obj);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception ex)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Redirect(ex.Message);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #20124d;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/9181339889541600371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/11/sending-mail-in-c-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/9181339889541600371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/9181339889541600371'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/11/sending-mail-in-c-aspnet.html' title='Sending Mail in C# Asp.net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-880945833463343387</id><published>2011-11-08T05:59:00.001-08:00</published><updated>2013-07-28T04:51:59.424-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sql stored procedure Add Operation"/><title type='text'>sql stored procedure Add Operation</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;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;sql stored procedure&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Create&amp;nbsp;PROCEDURE [dbo].[AddDEmp]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;( &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;@empName &amp;nbsp;Varchar(50),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;@empAge &amp;nbsp; &amp;nbsp;int, &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;@empEmail &amp;nbsp;nVarchar(50), &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;@PhoneNo &amp;nbsp;nVarchar(50) &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;) &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;AS &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;INSERT &amp;nbsp;INTO &amp;nbsp;empRecord(empName,empAge,empEmail,PhoneNo) VALUES(@empName,@empAge,@empEmail,@PhoneNo)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;--------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Collections.Generic;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Web;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Web.UI;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Data;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Data.SqlClient;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;public partial class storedProcedureInsert : System.Web.UI.Page&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Button1_Click(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string constr = &quot;Data Source=RLABSRV/SQLEXPRESS;Initial Catalog=employee;Integrated Security=True&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //DataTable allData = new DataTable();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlConnection con = new SqlConnection(constr);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmd = new SqlCommand(&quot;AddDEmp&quot;, con);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.CommandType = CommandType.StoredProcedure;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; con.Open();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters.Add(&quot;empName&quot;, SqlDbType.VarChar, 50);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters[&quot;empName&quot;].Value = TextBox1.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters.Add(&quot;empAge&quot;, SqlDbType.Int);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters[&quot;empAge&quot;].Value = TextBox2.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters.Add(&quot;empEmail&quot;, SqlDbType.NVarChar, 50);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters[&quot;empEmail&quot;].Value = TextBox3.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters.Add(&quot;PhoneNo&quot;, SqlDbType.NVarChar, 50);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters[&quot;PhoneNo&quot;].Value = TextBox4.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.ExecuteNonQuery();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; con.Close();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch(Exception ex)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; con.Close();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Label2.Text = ex.Message;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/880945833463343387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/11/sql-stored-procedure-add-operation_08.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/880945833463343387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/880945833463343387'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/11/sql-stored-procedure-add-operation_08.html' title='sql stored procedure Add Operation'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-7863763911670443057</id><published>2011-11-08T05:35:00.000-08:00</published><updated>2011-11-08T05:35:37.785-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Difference between DLL and Assembly"/><title type='text'>Difference between DLL and Assembly</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: red; font-size: large;&quot;&gt;Difference between DLL and Assembly&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
DLL is an&amp;nbsp;Inbound&amp;nbsp;Field.&lt;br /&gt;
There are many Dlls which can be present in a single Application.&lt;br /&gt;
Dlls can be shared with other Applications.&lt;br /&gt;
Dll is linked to an Exe during Run Time.&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
Exe is used for Launching an Application.&lt;br /&gt;
Exe is used for Single Application.&lt;br /&gt;
Exe cannot be shared with other Applications.&lt;br /&gt;
Exe runs on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/7863763911670443057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/11/difference-between-dll-and-assembly.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/7863763911670443057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/7863763911670443057'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/11/difference-between-dll-and-assembly.html' title='Difference between DLL and Assembly'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-226035221680563739</id><published>2011-07-25T05:28:00.000-07:00</published><updated>2013-08-17T02:23:12.925-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Connected and disconnected architecture in ADO.Net with Example (Disconnected architecture in asp.net)"/><title type='text'> Connected and disconnected architecture in ADO.Net with Example (Delete/Update Data in Disconnected architecture 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;div closure_uid_o4q73w=&quot;102&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;/h2&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Theory for Disconnected architecture in asp.net&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Connected and disconnected architecture in ADO.Net with Example (Delete/Update Data in Disconnected architecture in Asp.net)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;What is Disconnected Architecture in ADO.Net?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Disconnected Architecture is used when there is no requirement to have quick access to the Server.Thus Connection is not maintained with the server. Data is stored remotely using an Object called &quot;DataSet&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;A DataSet is a Local Copy of Relational Data and all Operations that needs to be carried out on the data are done on this Local copy on Client Side with no connection to the original data on Server.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;SqlDataAdapter Object is used to handle the additon,deletion,updation of data from the Data Source to DataSet.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Data Source is just a DataTable. adp.Fill() is a method &amp;nbsp;of SqlDataAdapter Object to populate a DataSet with the result of executed query.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Code for Default.aspx.cs is&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;--------------------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Configuration;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Data;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Web;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Web.Security;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Web.UI;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Web.UI.HtmlControls;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Web.UI.WebControls.WebParts;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Xml.Linq;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;using System.Data.SqlClient;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;public partial class _Default : System.Web.UI.Page&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;{ &amp;nbsp; &amp;nbsp; &amp;nbsp; //DISCONNECTED&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlConnection cn = new SqlConnection(&quot;data source=.;initial catalog=Amul;integrated security=sspi&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlDataAdapter adp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; DataSet dr;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlCommandBuilder cmb;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adp = new SqlDataAdapter(&quot;select * from employee&quot;, cn);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmb = new SqlCommandBuilder(adp);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dr = new DataSet();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adp.Fill(dr, &quot;emp&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataSource = dr;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataBind();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!Page.IsPostBack)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adp = new SqlDataAdapter(&quot;select emp_id from employee&quot;, cn);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp;foreach (DataRow r in dr.Tables[0].Rows)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&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;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DropDownList1.Items.Add(r[0].ToString()); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Button1_Click(object sender, EventArgs e)//UPDATE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataRow rw = dr.Tables[0].Rows[DropDownList1.SelectedIndex];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rw.BeginEdit();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rw[1] = TextBox1.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rw[2] = TextBox2.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rw[3] = TextBox3.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rw.EndEdit();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adp.Update(dr, &quot;emp&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Data is updated&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataSource = dr;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataBind();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Button2_Click(object sender, EventArgs e)//DELETE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string s = DropDownList1.SelectedItem.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataRow rw = dr.Tables[0].Rows[DropDownList1.SelectedIndex];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rw.Delete();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adp.Update(dr, &quot;emp&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Record is deleted&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Label5.Visible = true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DropDownList1.Items.Remove(s);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextBox1.Text = &quot;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextBox2.Text = &quot;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextBox3.Text = &quot;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataSource = dr;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataBind();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void DropDownList1_SelectedIndexChanged1(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int i = 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adp = new SqlDataAdapter(&quot;select * from employee where emp_id=&#39;&quot; + DropDownList1.SelectedItem.Text + &quot;&#39;&quot;, cn);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmb = new SqlCommandBuilder(adp);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //DataRow rw = new SqlCommandBuilder(adp);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataRow rw = dr.Tables[i].Rows[DropDownList1.SelectedIndex];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //DropDownList1.Text = rw[&quot;e_id&quot;].ToString();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/226035221680563739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/deleteupdate-data-in-disconnected.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/226035221680563739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/226035221680563739'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/deleteupdate-data-in-disconnected.html' title=' Connected and disconnected architecture in ADO.Net with Example (Delete/Update Data in Disconnected architecture in Asp.net)                            '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-9208449926178388695</id><published>2011-07-25T05:04:00.000-07:00</published><updated>2011-07-27T23:16:38.861-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Inheritance source code"/><title type='text'>Inheritance</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;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=aspnet04-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=1430225491&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;h2 class=&quot;postTitle&quot; closure_uid_1g0uzs=&quot;103&quot; style=&quot;color: #666666;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; closure_uid_1g0uzs=&quot;103&quot; style=&quot;color: #666666;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; closure_uid_1g0uzs=&quot;103&quot; style=&quot;color: #666666;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; closure_uid_1g0uzs=&quot;103&quot; style=&quot;color: #666666;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; closure_uid_1g0uzs=&quot;103&quot; closure_uid_8b6a6e=&quot;106&quot; style=&quot;color: #666666;&quot;&gt;&lt;span closure_uid_21qduk=&quot;115&quot; closure_uid_8b6a6e=&quot;104&quot; style=&quot;color: #eeeeee;&quot;&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;&lt;/span&gt;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; closure_uid_1g0uzs=&quot;103&quot; closure_uid_8b6a6e=&quot;106&quot; style=&quot;color: #666666;&quot;&gt;&lt;span closure_uid_21qduk=&quot;115&quot; closure_uid_8b6a6e=&quot;104&quot; style=&quot;color: #eeeeee;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;Inheritance&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;postBody&quot; style=&quot;color: #777777;&quot;&gt;&lt;div closure_uid_1g0uzs=&quot;107&quot; closure_uid_21qduk=&quot;114&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div closure_uid_1g0uzs=&quot;107&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div closure_uid_1g0uzs=&quot;107&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div closure_uid_1g0uzs=&quot;107&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div closure_uid_1g0uzs=&quot;107&quot;&gt;&lt;span closure_uid_1g0uzs=&quot;106&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong closure_uid_1g0uzs=&quot;105&quot; closure_uid_8b6a6e=&quot;120&quot;&gt;2E: A Learner&#39;s Guide to Real-World Programming with Visual C# and .NET (Head First Guides]Asp.Net sample projects&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;How to use inheritance in c# asp.net&lt;/strong&gt;&lt;strong&gt;Source Code to use Inheritance in c# Asp.Net&lt;/strong&gt;&lt;br /&gt;
&lt;strong closure_uid_8b6a6e=&quot;121&quot;&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div closure_uid_1g0uzs=&quot;107&quot;&gt;&lt;span closure_uid_1g0uzs=&quot;106&quot; style=&quot;color: black;&quot;&gt;&lt;strong closure_uid_8b6a6e=&quot;121&quot;&gt;&amp;nbsp;Inheritance &lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;Inheritance is a feature of Object Oriented Programming language.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Inheritance is a&amp;nbsp;way of communication &amp;nbsp;between classes.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;In Inheritance one is a parent class and other is a child class.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;In Inheritance parent class is called as base class and child class is called as sub class.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Inheritance Creates hierarchy of Objects.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;In C#,Inheritance is a process of&amp;nbsp; creating type such as a class or interface from an existing type such as a class or interface.&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Source Code to use Inheritance in c# asp.net&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;using System;&lt;br /&gt;
public class parentclass&lt;br /&gt;
{&lt;br /&gt;
public parentclass()&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ////I am coding a constructor&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;br /&gt;
Console.Writeline(&quot;Hi, My name is Amul.I am a parentclass constructor.&quot;);&lt;br /&gt;
Console.Writeline(&quot;I have same name as a class name.&quot;);&lt;br /&gt;
Console.Writeline(&quot;&quot;);&lt;br /&gt;
}&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;public void&amp;nbsp; parentclassmethod()&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; //// I am coding a Method&lt;br /&gt;
&amp;nbsp; {&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Console.Writeline(&quot;There is no need to create an Object for me as I am a constructor.(parentclass constructor.)&quot;);&lt;br /&gt;
Console.Writeline(&quot;I get Invoked Automatically.So Whatever is written in constructor is invoked first.&quot;);&lt;br /&gt;
Console.Writeline(&quot;Because of Me as a Constructor,Loading time required&amp;nbsp; is less.&quot;);&lt;br /&gt;
Console.Writeline(&quot;&quot;);&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
}&lt;/span&gt;&lt;/strong&gt;&lt;strong closure_uid_3r4808=&quot;120&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;public class childclass : parentclass&amp;nbsp;&amp;nbsp;&amp;nbsp; //////ParentClass is a base class of ChildClass.&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;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //////ChildClass inherites the functionalities of ParentClass&lt;br /&gt;
{&lt;br /&gt;
public childclass()&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //////I am coding a constructor&lt;br /&gt;
{&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;&amp;nbsp; Console.Writeline(&quot;Hi , I am Clone of Amul. I am a childclass constructor.&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.Writeline(&quot;I also have a name as that of class name.&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.Writeline(&quot;&quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public void childclassmethod()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //// I am coding a Method&lt;br /&gt;
{&lt;br /&gt;
Console.Writeline(&quot;There is no need to create an Object for me&amp;nbsp; also as I am a constructor.(childclass constructor.)&quot;);&lt;br /&gt;
Console.Writeline(&quot;I get Invoked Automatically.So Whatever is written in constructor is invoked first.&quot;);&lt;br /&gt;
Console.Writeline(&quot;Because of Me as a Constructor, Loading time required&amp;nbsp; is less.&quot;);&lt;br /&gt;
Console.Writeline(&quot;&quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public static void Main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;childclass&amp;nbsp; object1 = new childclass();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;childclass.parentclassmethod();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;childclass.childclassmethod();&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
OUT PUT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //////For Inheritance &lt;br /&gt;
Hi, My name is Amul.I am a parentclass constructor.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
I have same name as a class name.&lt;br /&gt;
Hi , I am Clone of Amul. I am a childclass constructor.&lt;br /&gt;
I also have a name as that of class name.&lt;br /&gt;
&lt;br /&gt;
There is no need to create an Object for me as I am a constructor.(parentclass constructor.)&lt;br /&gt;
I get Invoked Automatically.So Whatever is written in constructor is invoked first.&lt;br /&gt;
Because of Me as a Constructor, Loading time required&amp;nbsp; is less.&lt;br /&gt;
&lt;br /&gt;
There is no need to create an Object for me also as I am a constructor.(childclass constructor.)&lt;br /&gt;
I get Invoked Automatically.So Whatever is written in constructor is invoked first.&lt;br /&gt;
Because of Me as a Constructor, Loading time required&amp;nbsp; is less.&lt;br /&gt;
.&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/9208449926178388695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/inheritance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/9208449926178388695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/9208449926178388695'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/inheritance.html' title='Inheritance'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-100608715434806891</id><published>2011-07-25T04:59:00.000-07:00</published><updated>2011-11-07T00:52:25.374-08:00</updated><title type='text'>Method Overloading</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h2 class=&quot;postTitle&quot; style=&quot;color: #666666;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=aspnet04-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=1847192505&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; style=&quot;color: #666666;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; style=&quot;color: #666666;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; style=&quot;color: #666666;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; style=&quot;color: #666666;&quot;&gt;&lt;span closure_uid_1okxg4=&quot;113&quot; style=&quot;color: #eeeeee;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; style=&quot;color: #666666;&quot;&gt;&lt;span closure_uid_1okxg4=&quot;113&quot; style=&quot;color: #eeeeee;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; style=&quot;color: #666666;&quot;&gt;&lt;span closure_uid_1okxg4=&quot;113&quot; style=&quot;color: #eeeeee;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; style=&quot;color: #666666;&quot;&gt;&lt;span closure_uid_1okxg4=&quot;113&quot; style=&quot;color: #eeeeee;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2 class=&quot;postTitle&quot; style=&quot;color: #666666;&quot;&gt;&lt;span closure_uid_1okxg4=&quot;113&quot; closure_uid_a2ghya=&quot;102&quot; style=&quot;color: black;&quot;&gt;Method OverLoading&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;postBody&quot;&gt;&lt;strong style=&quot;color: #777777;&quot;&gt;Asp.Net sample projects&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;strong&gt;Method OverLoading&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;Method Overloading source code in C# asp.net&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;In Method Overloading one method can be used for two different Datatypes Int,Double.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;Method OverLoading&amp;nbsp; is Compile Time Polymorphism.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;Polymorphism&amp;nbsp;is an Object Oriented Programming Concept in which&amp;nbsp;same operation may behave differently on different classes.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;///////////////////////MethodOverloadclass.cs/////////////////////////////////////&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;using System;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;using System.Collections.Generic;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;using System.Text;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;namespace MethodOverloading&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; class MethodOverloadclass&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public int Add(int a, int b)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int c;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c = a + b;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return c;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public int Add(int a, int b, int c)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int d;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; d = a + b + c;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return d;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static void Add(double x, double y, double p, double q)//Word Static says no need to create an object.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //directly call method by class reference.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; double z;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; z = x + y + p + q;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Addition &amp;nbsp;of 4 nos is: &quot; + z);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;--------------------------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;////////////////////&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;Program.cs////////////////////////////////&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;using System;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;using System.Collections.Generic;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;using System.Text;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;using MethodOverloading;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;namespace MethodOverloading1&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; class Program&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MethodOverloadclass obj = new MethodOverloadclass();&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&quot;This is a program of Method OverLoading which uses Polymorphism&quot;);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&quot;Here we &amp;nbsp;added 2 nos and 3 nos and 4 nos with same Method defined &amp;nbsp;as Add.&quot;);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&quot;Addition of 2 nos is: &quot; + obj.Add(2,2));&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&quot;Addition of 3 nos is: &quot; + obj.Add(2, 2, 2));&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MethodOverloadclass.Add(10,10,10,10);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/100608715434806891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/method-overloading.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/100608715434806891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/100608715434806891'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/method-overloading.html' title='Method Overloading'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-2852068387304097237</id><published>2011-07-25T01:20:00.001-07:00</published><updated>2012-02-15T02:18:48.518-08:00</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/2852068387304097237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/2852068387304097237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/2852068387304097237'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/blog-post.html' title=''/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-7374407205173284724</id><published>2011-07-25T01:18:00.001-07:00</published><updated>2011-07-25T01:18:27.391-07:00</updated><title type='text'>Home</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/7374407205173284724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/home.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/7374407205173284724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/7374407205173284724'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/home.html' title='Home'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-8180855409853708700</id><published>2011-07-02T00:20:00.000-07:00</published><updated>2011-07-27T23:15:47.683-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRYPTOGRAPHY"/><title type='text'>CRYPTOGRAPHY</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Asp.Net sample projects&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;using System;&lt;br /&gt;
using System.Configuration;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Data;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.Security;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.HtmlControls;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.WebControls.WebParts;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Xml.Linq;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Data.SqlClient;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Security.Cryptography;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Text;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;public partial class_Default:System.Web.UI.Page&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;byte[] hashvalue,Messagebytes;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;string StringtoConvert;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;UnicodeEncoding MyUnicodeEncoding;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;protected void Page_Load(object sender,EventsArgs e)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;protected void ButtonSHA1_click(object sender,EventsArgs e)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;TextBox2.Text=&quot;&quot;;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;StringtoConvert=TextBox1.Text;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;MyUniCodeEncoding = new UniCodeEncoding();&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;MessageBytes = MyUniCodeEncoding.GetBytes(StringtoConvert);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;SHA1Managed SHhash = new SHA1Managed();&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;hashvalue = SHhash.ComputeHash(MessageBytes);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;foreach (byte b in hashValue)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;TextBox2.Text= TextBox2.Text + String.Format(&quot; {0:X2}&quot;,b);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;protected void ButtonSHA256_click(object sender,EventsArgs e)&lt;/span&gt;&lt;/strong&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;SHA256Managed SHhash = new SHA256Managed();&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;protected void ButtonSHA384_click(object sender,EventsArgs e)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;SHA384Managed SHhash = new SHA384Managed();&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div closure_uid_cdvy5u=&quot;103&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;protected void ButtonSHA512_click(object sender,EventsArgs e)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;SHA512Managed SHhash = new SHA512Managed();&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/8180855409853708700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/cryptography.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/8180855409853708700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/8180855409853708700'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/cryptography.html' title='CRYPTOGRAPHY'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-4541195705320505360</id><published>2011-07-01T22:42:00.000-07:00</published><updated>2013-08-17T02:18:04.726-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="connected and disconnected architecture in ASP.Net"/><title type='text'>Connected and Disconnected architecture in ADO.Net with Example(Delete/Update Data Connected Architecture 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;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Asp.Net sample projects&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp; Connected and Disconnected architecture in ADO.Net with Example(Delete/Update Data Connected Architecture in Asp.net)&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;b&gt;What is Connected Architecture in ADO.Net?&lt;/b&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;&quot;Connected&amp;nbsp; Architecture&quot;&amp;nbsp; means the connection is maintained&amp;nbsp;to the server (or database)&amp;nbsp;and it is &amp;nbsp;maintained Continously.&lt;/strong&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;DataReader is used in Connected Architecture.&lt;/strong&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;DataReader is used especialy when quick access to data is required without Storing the extracted data remotely.&lt;/strong&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;DataReader is created using the Command.Execute Reader.&lt;/strong&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Configuration;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Data;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.Security;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.HtmlControls;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.WebControls.WebParts;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Xml.Linq;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Data.SqlClient;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;public partial class _Default : System.Web.UI.Page&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;{//CONNECTED ARCHITECTURE.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlConnection cn = new SqlConnection(&quot;data source=.;initial catalog=Amul;integrated security=sspi&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlCommand cmd;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlDataReader rd;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!Page.IsPostBack)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd = new SqlCommand(&quot;select emp_id from employee&quot;, cn);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rd = cmd.ExecuteReader();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (rd.Read())&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DropDownList1.Items.Add(rd[0].ToString());&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rd.Close();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Button2_Click(object sender, EventArgs e)//DELETE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string id = DropDownList1.SelectedItem.Text;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd = new SqlCommand(&quot;delete &amp;nbsp;from employee where emp_id=&#39;&quot; +&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DropDownList1.SelectedItem.Text + &quot;&#39;&quot;, cn);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.ExecuteNonQuery();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Record is deleted&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DropDownList1.Items.Remove(id);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Button1_Click(object sender, EventArgs e)//UPDATE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int s;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string n, d;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; n = TextBox1.Text;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; d = TextBox2.Text;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s = int.Parse(TextBox3.Text);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd = new SqlCommand(&quot;update employee set emp_name=&#39;&quot; + n +&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&#39;,emp_dept=&#39;&quot; + d + &quot;&#39;,emp_salary=&#39;&quot; + s +&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&#39; where emp_id=&#39;&quot; + DropDownList1.SelectedItem.Text +&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&#39;&quot;, cn);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.ExecuteNonQuery();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Record is updated&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd = new SqlCommand(&quot;select * from employee where emp_id=&#39;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + DropDownList1.SelectedItem.Text + &quot;&#39;&quot;, cn);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rd = cmd.ExecuteReader();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rd.Read();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextBox1.Text = rd[1].ToString();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextBox2.Text = rd[2].ToString();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextBox3.Text = rd[3].ToString();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rd.Close();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/4541195705320505360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/deleteupdate-data-connected.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/4541195705320505360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/4541195705320505360'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/deleteupdate-data-connected.html' title='Connected and Disconnected architecture in ADO.Net with Example(Delete/Update Data Connected Architecture in Asp.net)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6071830986390841423.post-9083324491028099019</id><published>2011-07-01T22:21:00.000-07:00</published><updated>2013-08-10T04:23:34.965-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Insert Data in Connected Architecture"/><title type='text'>Connected and Disconnected architecture in ADO.Net with Example (Insert Data in Connected Architecture 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;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Source Code to&amp;nbsp;Insert Data in Connected Architecture&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;using System;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Configuration;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Data;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.Security;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.HtmlControls;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.WebControls.WebParts;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Xml.Linq;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Data.SqlClient;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;public partial class _Default : System.Web.UI.Page&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;{ &amp;nbsp; &amp;nbsp; &amp;nbsp; //Connected Architecture&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlConnection cn = new SqlConnection(&quot;data source =.; initial catalog= Amul;integrated security=sspi&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlCommand cmd;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlDataReader rd;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Button1_Click(object sender, EventArgs e)//INSERT BUTTON&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int id, sal;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string name, dept;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; id = int.Parse(TextBox1.Text);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; name = TextBox2.Text;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dept = TextBox3.Text;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sal = int.Parse(TextBox4.Text);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd = new SqlCommand(&quot;insert into employee values(&#39;&quot; +&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; id + &quot;&#39;,&#39;&quot; + name + &quot;&#39;,&#39;&quot; + dept + &quot;&#39;,&#39;&quot; + sal + &quot;&#39;)&quot;, cn);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.ExecuteNonQuery();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;New Record is added&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AmulMethod();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Button2_Click(object sender, EventArgs e)//SHOW DETAILS BUTTON&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AmulMethod();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; private void AmulMethod()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd = new SqlCommand(&quot;select * from employee&quot;, cn);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rd = cmd.ExecuteReader();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataSource = rd;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataBind();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/9083324491028099019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/insert-data-in-connected-architecture.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/9083324491028099019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/9083324491028099019'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/insert-data-in-connected-architecture.html' title='Connected and Disconnected architecture in ADO.Net with Example (Insert Data in Connected Architecture in Asp.net)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-2033265069988825804</id><published>2011-07-01T22:15:00.000-07:00</published><updated>2013-08-10T04:24:38.260-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code to insert data in disconnected in asp.net"/><title type='text'>Connected and Disconnected architecture in ADO.Net with Example (Insert Data in DisConnected Architecture 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;strong&gt;&lt;span closure_uid_7ltqei=&quot;102&quot; closure_uid_iihztf=&quot;102&quot; style=&quot;color: black;&quot;&gt;Asp.Net sample projects&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&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;&lt;span style=&quot;font-size: large;&quot;&gt; Insert Data in DisConnected Architecture&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;What is Disconnected Architecture in ADO.Net?&lt;/strong&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Disconnected Architecture is used when there is no requirement to have quick access to the Server.Thus Connection is not maintained with the server. &lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;Data is stored remotely using an Object called &quot;DataSet&quot;.&lt;/strong&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong closure_uid_46x4du=&quot;123&quot;&gt;A DataSet is a Local Copy of Relational Data and all Operations that needs to be carried out on the data are done on this Local copy on Client Side with no connection to the original data on Server.&lt;/strong&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;SqlDataAdapter Object is used to handle the additon,deletion,updation of data from the Data Source to DataSet.&lt;/strong&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;Data Source is just a DataTable.&lt;/strong&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;adp.Fill() is a method&amp;nbsp; of SqlDataAdapter Object to populate a DataSet with the result of executed query.&lt;/strong&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Configuration;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Data;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.Security;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.HtmlControls;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.WebControls.WebParts;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Xml.Linq;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Data.SqlClient;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;public partial class _Default : System.Web.UI.Page&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;{ //Disconnnected&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlConnection cn = new SqlConnection(&quot;data source=.;initial catalog=Amul;integrated security=sspi&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlDataAdapter adp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; DataSet ds;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; SqlCommandBuilder cmb;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;show();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; private void show()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adp = new SqlDataAdapter(&quot;select * from employee&quot;, cn);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmb = new SqlCommandBuilder(adp);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds = new DataSet();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adp.Fill(ds, &quot;emp&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataSource = ds.Tables[0];&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.DataBind();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Button1_Click(object sender, EventArgs e)//INSERT&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adp = new SqlDataAdapter(&quot;select * from employee&quot;, cn);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmb = new SqlCommandBuilder(adp);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds = new DataSet();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adp.Fill(ds, &quot;emp&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataRow rw = ds.Tables[0].NewRow();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rw[0] = TextBox1.Text;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rw[1] = TextBox2.Text;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rw[2] = TextBox3.Text;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rw[3] = TextBox4.Text;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds.Tables[0].Rows.Add(rw);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adp.Update(ds.Tables[0]);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Data is added&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; show();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/2033265069988825804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/insert-data-in-disconnected.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/2033265069988825804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/2033265069988825804'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/insert-data-in-disconnected.html' title='Connected and Disconnected architecture in ADO.Net with Example (Insert Data in DisConnected Architecture in Asp.Net)                  '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6071830986390841423.post-8761358697504173995</id><published>2011-07-01T03:45:00.000-07:00</published><updated>2011-07-27T22:59:25.935-07:00</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;span closure_uid_1q9z63=&quot;120&quot; style=&quot;font-size: small;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;span closure_uid_1q9z63=&quot;120&quot; style=&quot;font-size: small;&quot;&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=aspnet04-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=067232542X&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;span closure_uid_1q9z63=&quot;120&quot; closure_uid_2hzwrb=&quot;103&quot; style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;&lt;span closure_uid_1q9z63=&quot;120&quot; closure_uid_2hzwrb=&quot;103&quot; style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span closure_uid_1q9z63=&quot;120&quot; closure_uid_2hzwrb=&quot;103&quot; closure_uid_3bp3xl=&quot;102&quot; style=&quot;color: black; font-size: small;&quot;&gt;Asp.Net sample projects&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div closure_uid_1q9z63=&quot;105&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u closure_uid_1q9z63=&quot;103&quot; closure_uid_k81ols=&quot;103&quot;&gt;Understanding of Web Application that works after it is&amp;nbsp;been&amp;nbsp;Deployed on the web Server.&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/span&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;A Web Application created in ASP.Net is deployed in IIS Server and WAS.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span id=&quot;goog_1166049665&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1166049666&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1166049667&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1166049668&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1166049669&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1166049670&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;IIS is called as Internet Information Service&lt;br /&gt;
WAS is called as Windows Activation Service.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;If a client Browser for first time sends a request for any Web Application to the Web Browser&lt;br /&gt;
this request is passed to ASP.Net worker process.&lt;br /&gt;
From a Virtual Directory of IIS an Application is started and &lt;u&gt;Application Object&lt;/u&gt; is Created.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;A class called as &lt;u&gt;‘ApplicationManager’&lt;/u&gt; creates an &lt;u&gt;Application Domain&lt;/u&gt;.&lt;br /&gt;
Application Domain is a Domain in which the Website runs.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Main work of Application Domain is to seperate Two or more Applications which are &lt;br /&gt;
hosted on same IIS Server.&lt;br /&gt;
An Application Domain is actually implemented by CLR.&lt;br /&gt;
CLR is called as Common Language Runtime.&lt;br /&gt;
It is a prime Objective of Application Domain to prevent concurrently running applications from &lt;br /&gt;
entering into each other&#39;s Domain.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;This Application Domain creates hosting environment,&lt;br /&gt;
1.&lt;u&gt; ‘HttpRuntime’ object.&lt;/u&gt; &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;The HttpRuntime object is used at the beginning of the ASP.NET pipeline model that processes HTTP requests. &lt;br /&gt;
HTTP&amp;nbsp; means Hyper Text Transfer Protocol.&lt;br /&gt;
The ProcessRequest method drives all subsequent ASP.NET Web processing. &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;u&gt;HttpRuntime Object&lt;/u&gt;Web Developers&amp;nbsp; can use the HttpRuntime class properties to find out information about the current Application Domain for getting information.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Once the hosting environment is created, the other important&amp;nbsp; ASP.NET objects such as&amp;nbsp; ‘HttpContext’ , &lt;br /&gt;
‘HttpRequest’ and ‘HttpResponse’ objects are created.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;color: black;&quot;&gt;HttpContext Object&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;The HttpContext object in the System.Web namespace encapsulates all of the information related to one request and allows you to access that information within or outside of the actual aspx page that is being processed. &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;color: black;&quot;&gt;HttpRequest Object &lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;The HttpRequest object&amp;nbsp; can be used by a client to send an arbitrary HTTP request. &lt;br /&gt;
HttpRequest is basically Microsoft XMLHTTP request.&lt;br /&gt;
It is also used to receive the response, and have that response parsed by the Microsoft XML Document Object Model. &lt;br /&gt;
This object is integrated with MicrosoftXML to support sending the request body directly from, &lt;br /&gt;
and parsing the response directly into, the MSXML DOM objects. &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;HttpResponse Object&lt;br /&gt;
With the XMLHttpRequest object you can update parts of a web page, without reloading the whole page.&lt;br /&gt;
With the XMLHttpRequest object we Developers can&lt;br /&gt;
•Send data to a server.&lt;br /&gt;
•Modify a web page without reloading the page.&lt;br /&gt;
•Request data from a server after the page has loaded. &lt;br /&gt;
•Receive data from a server after the page has loaded.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div closure_uid_k81ols=&quot;105&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Once all the&amp;nbsp; ASP.NET objects are created, ‘HttpApplication’ object is created to serve the request. &lt;br /&gt;
If&amp;nbsp; you have a ‘global.asax’ file in your system, then the object of the ‘global.asax’ file will be created. &lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Global.asax file contains Event Handlers to respond to events such as starting of an ASP.Net Web Application for the first time.&lt;br /&gt;
The first time an ASP.NET page is attached to an application, a new instance of ‘HttpApplication’ is created.&lt;br /&gt;
The HttpApplication object is then assigned to the core ASP.NET objects to process the page.&lt;br /&gt;
HttpApplication then starts processing the request by HTTP module events, handlers and page events.&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/8761358697504173995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/understanding-of-web-application-that.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/8761358697504173995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/8761358697504173995'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/07/understanding-of-web-application-that.html' title=''/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-1165520226358097265</id><published>2011-06-21T22:09:00.000-07:00</published><updated>2011-07-27T22:58:16.656-07:00</updated><title type='text'>Static Classes</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;strong closure_uid_a16t9u=&quot;103&quot;&gt;&lt;span closure_uid_6ycrhi=&quot;102&quot; style=&quot;color: black;&quot;&gt;Asp.Net sample projects&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&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;&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;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&amp;nbsp; &lt;u&gt;Static Classes&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Classes&amp;nbsp; that do not have or contain representative (instance) members and do not have a constructor that can be called as Static Classes.&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Static Keyword is used for declaring Static Class.&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;No need to create objects so program execution is faster.&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Example&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Using System;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Namespace StaticProgram;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Class Program&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Static void main (string[]args)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Demo.Display1();&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Demo.Display2();&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Static Class Demo&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;public static string sa;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;static string sb;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;public static void Display1()&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;sa=&quot;Amul&quot;;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;console.writeline(&quot;{0}Says&quot;,sa);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;console.writeline(&quot;I am in Static method Display1(),So I can be called by Class Representation.I don&#39;t require an Object Declaration&quot;);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;public static void Display2()&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;{&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;sb=&quot;Amul&quot;;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;console.writeline(&quot;{0}Says&quot;,sb);&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;console.writeline(&quot;I am also&amp;nbsp;in Static method Display2(),So I can be called by Class Representation.I don&#39;t require an Object Declaration&quot;);&lt;/strong&gt;&lt;br /&gt;
}&lt;br /&gt;
}&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/1165520226358097265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/06/static-classes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/1165520226358097265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/1165520226358097265'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/06/static-classes.html' title='Static Classes'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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-6071830986390841423.post-7297935705375462496</id><published>2011-05-30T11:09:00.000-07:00</published><updated>2011-07-27T22:56:34.800-07:00</updated><title type='text'>ASP.Net Sample Projects.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;strong closure_uid_ou70zu=&quot;103&quot;&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=aspnet04-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=047018759X&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&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;&lt;span style=&quot;color: #eeeeee;&quot;&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;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong closure_uid_ou70zu=&quot;103&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong closure_uid_ou70zu=&quot;103&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&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;&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; &lt;/span&gt;&lt;span style=&quot;color: black; font-size: large;&quot;&gt;&lt;u closure_uid_mes8gc=&quot;104&quot; closure_uid_ou70zu=&quot;121&quot;&gt;ASP.Net Page Life &amp;nbsp;Cycle&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div closure_uid_mes8gc=&quot;102&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span closure_uid_ou70zu=&quot;120&quot; style=&quot;color: black;&quot;&gt;Asp.Net sample projects&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;(.net sample projects web)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;This is to see how ASP.Net Page Cycle is&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;This code is written in Default.aspx.cs&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Data;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Configuration;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.Security;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.WebControls.WebParts;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;using System.Web.UI.HtmlControls;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;public partial class _Default : System.Web.UI.Page&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_PreInit(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Page_PreInit&amp;lt;br/&amp;gt;&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Init(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Page_Init&amp;lt;br/&amp;gt;&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_InitComplete(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Page_InitComplete&amp;lt;br/&amp;gt;&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_PreLoad(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Page_PreLoad&amp;lt;br/&amp;gt;&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Page_Load&amp;lt;br/&amp;gt;&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_LoadComplete(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Page_LoadComplete&amp;lt;br/&amp;gt;&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_PreRender(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Page_PreRender&amp;lt;br/&amp;gt;&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Page_Render(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Page_Render&amp;lt;br/&amp;gt;&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void Button1_Click(object sender, EventArgs e)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;Button1_Click&amp;lt;br/&amp;gt;&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;(.net sample projects web)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amul-aspnetsampleprojects.blogspot.com/feeds/7297935705375462496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/05/aspnet-sample-projects.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/7297935705375462496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6071830986390841423/posts/default/7297935705375462496'/><link rel='alternate' type='text/html' href='http://amul-aspnetsampleprojects.blogspot.com/2011/05/aspnet-sample-projects.html' title='ASP.Net Sample Projects.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11021735176532528565</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>