<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3179608265346366143</id><updated>2011-12-11T19:56:28.675-08:00</updated><category term='Asp.Net Page Life Cycle'/><category term='C# Interview Questions'/><category term='3-Tier Architecture'/><category term='Asp.Net Interview Questions'/><category term='Populate Data from Database'/><category term='State Management'/><category term='SQL  Interview Questions'/><category term='Validationg user credentials'/><category term='Directives In Asp.Net'/><category term='DataBase Connection'/><title type='text'>Asp.Net Interview Questions</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>37</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-5319999374521047388</id><published>2010-03-24T08:43:00.000-07:00</published><updated>2010-03-24T08:47:01.010-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL  Interview Questions'/><title type='text'>SQL InterviewQuestions-Part4</title><content type='html'>31) What is the difference between stored procedure and a trigger?&lt;br /&gt;a.  Storedprocedure&lt;br /&gt;    1. We should call it explicitly&lt;br /&gt;    2. They can't be inactive&lt;br /&gt;    Trigger&lt;br /&gt;    1. They can be called automatically inplace of or after (data modifications) triggering actions like Insert, delete or update&lt;br /&gt;    2. Thay can be inactive&lt;br /&gt;     &lt;br /&gt;&lt;br /&gt;32) What is normalization?&lt;br /&gt;a.  It is a process of organizing data efficiently in database.&lt;br /&gt;&lt;br /&gt;33) Advantages of normalization?&lt;br /&gt;a.  1. It reduces redundant data&lt;br /&gt;    2. Ensures that data dependencies make sense&lt;br /&gt;&lt;br /&gt;34) Why we use join?&lt;br /&gt;a.  Joins are used to query data from two or more tables, based on a relationship between certain columns in these tables&lt;br /&gt;&lt;br /&gt;35) Types of joins?&lt;br /&gt;a.  1. Join:       Returns rows which have match in both the tables&lt;br /&gt;    2. Left Join:  Returns rows which have match and the rows from the left table which have no match for them in right table&lt;br /&gt;    3. Right Join: Returns rows which have match and the rows from the right table which have no match for them in left table&lt;br /&gt;    4. Full Join : Returns rows when there is a match in one of the tables&lt;br /&gt;&lt;br /&gt;36) why we use Rollback statement?&lt;br /&gt;a.  It cancels the proposed changes in a pending database transaction&lt;br /&gt;&lt;br /&gt;37) why we use Check constraint?&lt;br /&gt;a.  It is used to limit the value range that can be placed in a column&lt;br /&gt;&lt;br /&gt;38) why we use NOW() function?&lt;br /&gt;a.  It returns the current system date and time&lt;br /&gt;&lt;br /&gt;39) What is a subquery?&lt;br /&gt;a.  A subquery is a query that appears with in another SQL data manipulation statement&lt;br /&gt;&lt;br /&gt;40) Why we use DATEPART() function?&lt;br /&gt;a.  It Returns a single part of a date/time&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-5319999374521047388?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/5319999374521047388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=5319999374521047388' title='38 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/5319999374521047388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/5319999374521047388'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2010/03/sql-interviewquestions-part4.html' title='SQL InterviewQuestions-Part4'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>38</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-2973758983639107704</id><published>2010-02-04T13:26:00.000-08:00</published><updated>2010-02-04T13:32:59.278-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL  Interview Questions'/><title type='text'>SQL InterviewQuestions-Part3</title><content type='html'>21) What is select into command?&lt;br /&gt;a. It selects values from one table and inserts them into another table at the same time&lt;br /&gt;   ex:  SELECT column1, column2,&lt;br /&gt;        INTO table2&lt;br /&gt;        FROM table1&lt;br /&gt;&lt;br /&gt;22) Why we use DISTINCT command?&lt;br /&gt;a.  This is used to return only distinct values. It is used only with Select command.&lt;br /&gt;    ex: Select DISTINCT column(s) &lt;br /&gt;        From table&lt;br /&gt;&lt;br /&gt;23)  What are the wild cards?&lt;br /&gt;a. These are used to substitute one or more characters when searching for data in a database&lt;br /&gt;   %  is used to substitute zero or more characters&lt;br /&gt;   [charlist] any single character in charlist&lt;br /&gt;   _  substitute for exactly single character&lt;br /&gt;   [^charlist] any single character not in list&lt;br /&gt;&lt;br /&gt;24) Can we create indexes on views?&lt;br /&gt;a. Yes&lt;br /&gt;&lt;br /&gt;25) what is the first index that we can create on a view?&lt;br /&gt;a. It must be unique clustered index&lt;br /&gt;&lt;br /&gt;26) what are temporary stored procedures?&lt;br /&gt;a. Temporary stored procedures are like temporary tables and are dropped automatically when you disconnect. They are stored in tempdb and are useful when connected to earlier versions of SQL Server.They can be used when an application builds dynamic t-sql statements that are executed several times.Rather than have the t-sql statements recompiled each time, you can create a temporary stored procedure that is compiled on the first execution and then execute the precompiled plan multiple times.&lt;br /&gt;&lt;br /&gt;27) What is referential integrity?&lt;br /&gt;a. It indicates that the relationships between tables have been properly maintained&lt;br /&gt;&lt;br /&gt;28) what is Default constraint?&lt;br /&gt;a. It is used to insert default value in to a column&lt;br /&gt;&lt;br /&gt;29) How many bytes a currency datatype requires?&lt;br /&gt;a. 8 bytes&lt;br /&gt;&lt;br /&gt;30) Can we use Where clause with aggrigate functions?&lt;br /&gt;a. No&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-2973758983639107704?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/2973758983639107704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=2973758983639107704' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/2973758983639107704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/2973758983639107704'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2010/02/sql-interviewquestions-part3.html' title='SQL InterviewQuestions-Part3'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-3714281728294812202</id><published>2010-01-26T11:17:00.000-08:00</published><updated>2010-01-26T11:23:38.982-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL  Interview Questions'/><title type='text'>SQL InterviewQuestions Part2</title><content type='html'>11) what is a constraint?&lt;br /&gt;a) A constraint is a property which is assigned to a column or set of columns  in a table.   There are 5 types of constraints&lt;br /&gt;   Primary key, Unique key, Foreign Key, Check, Not Null&lt;br /&gt;&lt;br /&gt;12) What is an entity integrity?&lt;br /&gt;a)  This ensures that there can not be duplicate rows in a table&lt;br /&gt;&lt;br /&gt;13) What is a Trigger?&lt;br /&gt;a)  A trigger is a special of stored procedure which will be executed &lt;br /&gt;automatically in place of or after data modifications. There are 2 types of triggers&lt;br /&gt;    &lt;strong&gt;After triggers:&lt;/strong&gt;       This is the trigger which will be executed automatically after the statement which triggered it completes&lt;br /&gt;    &lt;strong&gt;Instead of Triggers&lt;/strong&gt;       This is the trigger which will be executed automatically in place of triggering statement&lt;br /&gt;&lt;br /&gt;14) How many after triggers we can crate for a table?&lt;br /&gt;a)  We can create any number of after triggers for each Insert, Update, Delete operations on a table&lt;br /&gt;&lt;br /&gt;15) How many Instead of triggers can be created for a table?&lt;br /&gt;a)  Only one for each Insert, Delete, Update operations&lt;br /&gt;&lt;br /&gt;16) Can a trigger be encrypted?&lt;br /&gt;a)  Yes. &lt;br /&gt;&lt;br /&gt;17) what is the stored procedure used to set the order of after triggers?&lt;br /&gt;a)  sp_settriggerorder&lt;br /&gt;&lt;br /&gt;18) can we create after triggers on a view?&lt;br /&gt;a)  No&lt;br /&gt; &lt;br /&gt;19) what is a view?&lt;br /&gt;a)  A view is a virtual table which contains columns from one or more tables.&lt;br /&gt;&lt;br /&gt;20) what are the advantages of views?&lt;br /&gt;a)  1. It provides security. means if a view is created on a table then the users can access only those columns which are there in view. they cannot access all the columns&lt;br /&gt;    2. It simplifies query execution means a complex query can be stored in the form of a view and view can be accessed  using a simple query.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-3714281728294812202?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/3714281728294812202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=3714281728294812202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/3714281728294812202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/3714281728294812202'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2010/01/sql-interviewquestions-part2.html' title='SQL InterviewQuestions Part2'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-6469394543296227443</id><published>2010-01-20T09:01:00.000-08:00</published><updated>2010-01-20T09:10:40.176-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL  Interview Questions'/><title type='text'>SQL InterviewQuestions Part1</title><content type='html'>1) Differences between Having and Where&lt;br /&gt;   Having:&lt;br /&gt;1) It applies to a group as a whole&lt;br /&gt;2) It selects rows afetr grouping&lt;br /&gt;3) It can contain aggrigate functions&lt;br /&gt;4) It is used only in select clause&lt;br /&gt;   Where:&lt;br /&gt;1) It applies to individual rows&lt;br /&gt;2) It selects rows before grouping&lt;br /&gt;3) It can't contain aggrigate functions&lt;br /&gt;4) It can be used in select, delete, insert etc&lt;br /&gt;&lt;br /&gt;2) What is a primary key?&lt;br /&gt;a) 1)A primary key is used to uniquely identify a row in a table. &lt;br /&gt;2) A table can have only one primary key.&lt;br /&gt;3) It does not allows nulls&lt;br /&gt;4) It creats a clusterd index on a column&lt;br /&gt;&lt;br /&gt;3) What is a clustered index?&lt;br /&gt;a) In a clustered index the logical order of index matches the physical &lt;br /&gt;   stored order of the rows in a disk. A table can have only one clustered &lt;br /&gt;   index. The leaf nodes of clustered index contains the data pages(actual data)&lt;br /&gt;&lt;br /&gt;4) What is a transaction and what are its properties?&lt;br /&gt;a) A transaction is a logical unit of work in which all steps must be performed or none. It has 4 main properties&lt;br /&gt;   a) Atomicity&lt;br /&gt;   b) Consistency&lt;br /&gt;   c) Isolation&lt;br /&gt;   d) Durability&lt;br /&gt;&lt;br /&gt;5) How many non clustered indexes we can create on a table&lt;br /&gt;a) More than one&lt;br /&gt;&lt;br /&gt;6) Differences between Union and UnionAll&lt;br /&gt;a) Union:&lt;br /&gt;1) This is used to eliminate duplicate rows&lt;br /&gt;2) This selects only distinct rows&lt;br /&gt;3) It can be used to combine any number of queries&lt;br /&gt;4) It can't contain aggrigate functions&lt;br /&gt;   UnionAll:&lt;br /&gt;1) It will not eliminate duplicate rows&lt;br /&gt;2) It selects all the values&lt;br /&gt;3) It can be used to combine maximum of 2 quesries&lt;br /&gt;4) It can contain aggrigate functions&lt;br /&gt;&lt;br /&gt;7) What is a composite key?&lt;br /&gt;a) A key formed by combining 2 or more columns is called composite key&lt;br /&gt;&lt;br /&gt;8) how many nulls a unique key allows?&lt;br /&gt;a) It allows only one null&lt;br /&gt;&lt;br /&gt;9) Differences between Delete and Truncate?&lt;br /&gt;a) Delete:&lt;br /&gt;1) It is a DML statement&lt;br /&gt;2) It can activate a trigger&lt;br /&gt;3) It can include a Where clause&lt;br /&gt;   Truncate:&lt;br /&gt;1) It is a DDL statement&lt;br /&gt;2) It cann't activate a trigger&lt;br /&gt;3) It can't include Where clause&lt;br /&gt;&lt;br /&gt;10) what is Atomicity?&lt;br /&gt;a) It states that database modifications must follow all or none, &lt;br /&gt;means if a part of a transaction fails then the entire transaction fails.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-6469394543296227443?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/6469394543296227443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=6469394543296227443' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/6469394543296227443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/6469394543296227443'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2010/01/sql-interviewquestions-part-1.html' title='SQL InterviewQuestions Part1'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-2041383487791083772</id><published>2009-10-21T07:05:00.000-07:00</published><updated>2009-10-21T07:19:13.075-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Validationg user credentials'/><title type='text'>Validating User Credentials</title><content type='html'>Validating User Credentials&lt;br /&gt;---------------------------------&lt;br /&gt;&lt;br /&gt;Let us see how to validate the user credentials(login and password)&lt;br /&gt;&lt;br /&gt;In aspx.cs under Button_Click() method write the following code&lt;br /&gt;&lt;br /&gt;        string email= txtemail.Text;&lt;br /&gt;        string password = txtpassword.Text;&lt;br /&gt;&lt;br /&gt;        SqlConnection con = new SqlConnection(connectionstring);&lt;br /&gt;        string str = “select * from UserLoginInfo where email=’ ” + email + “ ‘ and password = ‘ “ + password + “ ‘ “;&lt;br /&gt;        SqlCommand cmd = new SqlCommand(str, con);&lt;br /&gt;&lt;br /&gt;        try&lt;br /&gt;            {&lt;br /&gt;            con.Open();&lt;br /&gt;            SqlDataReader dr = cmd.ExecuteReader();&lt;br /&gt;            bool userexists = false;&lt;br /&gt;&lt;br /&gt;            while(dr.Read())&lt;br /&gt;              {&lt;br /&gt;              userexists = true;&lt;br /&gt;              }&lt;br /&gt;              if(userexists)&lt;br /&gt;              {&lt;br /&gt;              Server.Transfer(“Nextpage.aspx”);&lt;br /&gt;              }&lt;br /&gt;              else&lt;br /&gt;              {&lt;br /&gt;              lblresult.Text = “ Please enter the valid email and password”;&lt;br /&gt;              }&lt;br /&gt;              catch(exception e)&lt;br /&gt;              {&lt;br /&gt;               throw e;&lt;br /&gt;              }&lt;br /&gt;              finally&lt;br /&gt;              {&lt;br /&gt;               con.Close();&lt;br /&gt;              }&lt;br /&gt;             }&lt;br /&gt;&lt;br /&gt;Here we are taking the user entered values(textbox values) into strings and checking them with the values in table UserLoginInfo. If both the values matches then the variable userexists becomes true and you will be derected to another(in this case Nextpage.aspx) page otherwise user will get the message “please enter the valid email and password.&lt;br /&gt;&lt;br /&gt;In .aspx page create 2 textboxes for email and password and 1 submit button. In button_click method write the above code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-2041383487791083772?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/2041383487791083772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=2041383487791083772' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/2041383487791083772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/2041383487791083772'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/10/validating-user-credentials.html' title='Validating User Credentials'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-213256005338014626</id><published>2009-09-23T14:50:00.000-07:00</published><updated>2009-09-23T15:29:21.601-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3-Tier Architecture'/><title type='text'>3-Tier Architecture</title><content type='html'>3-Tier Architecture&lt;br /&gt;-----------------------&lt;br /&gt;Today Iam going to discuss about the 3-Tier Architecture .&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;PresentationLayer: &lt;/strong&gt;     This is the layer through which user enters the values or values are shown to the user.&lt;br /&gt;&lt;strong&gt;BusinessAccessLayer:&lt;/strong&gt;    This layer is used to perform calculations, validations and write business logic.&lt;br /&gt;&lt;strong&gt;DataAccessLayer:  &lt;/strong&gt;      This layer is used to connect to the database and perform the required actions which may be inserting, deleting, updating  values to database or from database.&lt;br /&gt;&lt;br /&gt;First   create a table with firstname, lastname, age as its columns. Then write a storedprocedure to insert values in to that table. &lt;br /&gt;&lt;br /&gt;Then in the project create a class library with the name  &lt;strong&gt;&lt;em&gt;DataAccessLayer.&lt;/em&gt;&lt;/strong&gt;In this class library create a class with the name UserInformationDAO and write the following code &lt;br /&gt;&lt;br /&gt;public class UserInformationDAO&lt;br /&gt;&amp;nbsp&amp;nbsp&amp;nbsp{&lt;br /&gt;   public void InsertUserInfo(string  firstname,  string  lastname,  int age)&lt;br /&gt;      &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp{&lt;br /&gt;         &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspSqlConnection  con   =  new  SqlConnection(connectionstring);&lt;br /&gt;         &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspSqlCommand    cmd  =  new  SqlCommand(“InsertUserData”, con);&lt;br /&gt;         &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspcmd.CommandType  =  CommandType.StoredProcedure;&lt;br /&gt;  &lt;br /&gt;         cmd.Parameters.Add(“@firstname” , SqlDbType.Varchar, 30).value =  firstname;&lt;br /&gt;         cmd.Parameters.Add(“@lastname” , SqlDbType.Varchar, 30).value =  lastname;&lt;br /&gt;         cmd.Parameters.Add(“@age” , SqlDbType.Int).value =   age;&lt;br /&gt;&lt;br /&gt;         try&lt;br /&gt;            &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp{&lt;br /&gt;                 &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspcon.Open();&lt;br /&gt;                 &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspcmd.ExecuteNonQuery();&lt;br /&gt;            &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp}&lt;br /&gt;         catch(Exception e)&lt;br /&gt;            &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp{&lt;br /&gt;                   &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspthrow e;&lt;br /&gt;            &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp}&lt;br /&gt;          finally&lt;br /&gt;             &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp{&lt;br /&gt;                   &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspcon.Close();&lt;br /&gt;             &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp}&lt;br /&gt;     &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp}&lt;br /&gt; &amp;nbsp&amp;nbsp&amp;nbsp}        &lt;br /&gt;          &lt;br /&gt;In the above code   connectionstring  means  connection parameters.  Which contains  servername,databasename, userid, password.&lt;br /&gt;InsertUserData  is the name of the storedprocedure to insert values in to the &lt;br /&gt;table. @firstname,@lastname,@age are the storedprocedure variables.Using cmd.Parameters.Add   we are adding values to cmd.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now once again  create a class library  named  &lt;strong&gt;&lt;em&gt;BusinessAccessLayer &lt;/em&gt;&lt;/strong&gt;   and create a class in that named  UserInformationBAO.&lt;br /&gt;&lt;br /&gt;public  class UserInformationBAO&lt;br /&gt;  {&lt;br /&gt;     private  string  firstname;&lt;br /&gt;     private  string  lastname;&lt;br /&gt;     private  int  age;&lt;br /&gt;    &lt;br /&gt;     public   string   FirstName&lt;br /&gt;       &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp{&lt;br /&gt;           &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspget {  return firstname;}&lt;br /&gt;           &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspset {  firstname  =  value;}&lt;br /&gt;       &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp}&lt;br /&gt;     public   string   LastName&lt;br /&gt;       &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp{&lt;br /&gt;          &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp get {  return lastname;}&lt;br /&gt;           &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspset {  lastname  =  value;}&lt;br /&gt;       &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp}&lt;br /&gt;       public  int   Age&lt;br /&gt;       &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp{&lt;br /&gt;           &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspget {  return age;}&lt;br /&gt;           &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspset {  age =  value;}&lt;br /&gt;       &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp}&lt;br /&gt;&lt;br /&gt;     public  void  InsertUserInfo()&lt;br /&gt;       &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp{&lt;br /&gt;              &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspUserInformationDAO   uinfo =  new  UserInformationDAO()&lt;br /&gt;              &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspuinfo. InsertUserInfo(FirstName,  LastName, Age);&lt;br /&gt;       &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;In the above code  we have  written  3 properties.  In InsertUserInfo  method  we are creating an object of  UserInformationDAO class,  using that we are invoking the method InsertUserInfo of UserInformationDAO  class.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In  .aspx.cs  page  you need to write the following code to read values from textboxes.&lt;br /&gt;&lt;br /&gt;protected  void  btnsubmit_Click(object  sender,  EventArgs   e)&lt;br /&gt;   &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp{&lt;br /&gt;      &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspUserInformationBAO  uinfobao    =   new   UserInformationBAO();&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;nbspuinfobao.FirstName  =   txtfirstname.Text;&lt;br /&gt;        &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspuinfobao.LastName   =   txtlastname.Text;&lt;br /&gt;        &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspuinfobao.Age        =   txtage.Text;&lt;br /&gt;        &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspuinfibao.InsertUserInfo();&lt;br /&gt;    &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp}&lt;br /&gt;&lt;br /&gt;Here first we are creating an object of  UserInformationBAO  class and using that object  we  are reading the values in to properties.&lt;br /&gt;&lt;br /&gt;In  .aspx page  you will have 3 textboxes for firstname, lastname and age.  Below these  you should create a button  so that when this button is clicked values from text boxes will be saved in to database.&lt;br /&gt;&lt;br /&gt;&amp;ltdiv&amp;gt&lt;br /&gt;&amp;lttable&amp;gt&lt;br /&gt;&amp;lttr&amp;gt&lt;br /&gt;&amp;lttd&amp;gt&lt;br /&gt;&amp;ltasp:Label    ID=”lblfirstname”   runat= “server”&amp;gtFirstName &amp;lt/asp:Label&amp;gt&lt;br /&gt;&amp;ltasp:Textbox   ID=”txtfirstname”   runat = “server” &amp;gt&amp;lt/asp:Textbox&amp;gt&lt;br /&gt;&amp;lt/td&amp;gt&lt;br /&gt;&amp;lt/tr&amp;gt&lt;br /&gt;&lt;br /&gt;&amp;lttr&amp;gt&lt;br /&gt;&amp;lttd&amp;gt&lt;br /&gt;&amp;ltasp:Label    ID=”lbllastname”   runat= “server”  &amp;gtLastName&amp;lt/asp:Label&amp;gt&lt;br /&gt;&amp;ltasp:Textbox   ID=”txtlastname”   runat = “server” &amp;gt&amp;lt/asp:Textbox&amp;gt&lt;br /&gt;&amp;lt/td&amp;gt&lt;br /&gt;&amp;lt/tr&amp;gt&lt;br /&gt;&lt;br /&gt;&amp;lttr&amp;gt&lt;br /&gt;&amp;lttd&amp;gt&lt;br /&gt;&amp;ltasp:Label     ID=”lblage"   runat= “server”  &amp;gtAge&amp;lt/asp:Label&amp;gt&lt;br /&gt;&amp;ltasp:Textbox    ID=”txtage”   runat = “server” &amp;gt&amp;lt/asp:Textbox&amp;gt&lt;br /&gt;&amp;lt/td&amp;gt&lt;br /&gt;&amp;lt/tr&amp;gt&lt;br /&gt;&lt;br /&gt;&amp;lttr&amp;gt&lt;br /&gt;&amp;lttd&amp;gt&lt;br /&gt;&amp;ltasp:Button    ID=”btnsubmit”   runat= “server”  Text = “Submit”  OnClick= “btnsubmit_Click”&amp;gt&amp;lt/asp:Button&amp;gt&lt;br /&gt;&amp;lt/td&amp;gt&lt;br /&gt;&amp;lt/tr&amp;gt&lt;br /&gt;&amp;lt/table&amp;gt&lt;br /&gt;&amp;lt/div&amp;gt&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-213256005338014626?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/213256005338014626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=213256005338014626' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/213256005338014626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/213256005338014626'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/09/3-tier-architecture.html' title='3-Tier Architecture'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-3093403705770391198</id><published>2009-08-18T06:19:00.000-07:00</published><updated>2009-10-21T07:05:06.252-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Populate Data from Database'/><title type='text'>Binding Data to Dropdownlist from Database</title><content type='html'>Binding Data to Dropdownlist from DataBase&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;Today Iam going to write on Binding Data to Dropdownlist from Database&lt;br /&gt;&lt;br /&gt;Consider that we want to populate the Dropdownlist  with a list of countries. For  this first we need to create a new .aspx  page with the following code&lt;br /&gt;&lt;br /&gt;&amp;ltasp:dropdownlist id =" “dpdcountry”" runat="”server”"&amp;gt&lt;br /&gt;&amp;lt/dropdownlist&amp;gt&lt;br /&gt;&lt;br /&gt;Now create a new classlibrary with the  class name DataBinding.cs and write the following code&lt;br /&gt;&lt;br /&gt;public class Databinding&lt;br /&gt;{&lt;br /&gt;    public static DataTable  Execute(string    sqlstring)&lt;br /&gt;    {&lt;br /&gt;        SqlConnection con =  new SqlConnection(connectionstring);&lt;br /&gt;        DataTable dt = new DataTable(“tb1”);&lt;br /&gt;        try&lt;br /&gt;             {&lt;br /&gt;                 con.Open();&lt;br /&gt;                 SqlCommand    cmd =  new  SqlCommand(sqlstring, con);&lt;br /&gt;                 SqlDataAdapter    da =  new  SqlDataAdapter(cmd);&lt;br /&gt;                 da.Fill(dt)    ;&lt;br /&gt;              }&lt;br /&gt;           catch(Exception e)&lt;br /&gt;             {   &lt;br /&gt;                 throw  e;&lt;br /&gt;              }&lt;br /&gt;            finally&lt;br /&gt;              {&lt;br /&gt;                  con.Close();&lt;br /&gt;               }&lt;br /&gt;                          &lt;br /&gt;&lt;br /&gt;                 return    dt;&lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In  the above code Databinding is the class name,  Execute is the method  which returns a datatable.  In the connectionstring you need to specify the 4 parameters of the SqlConnection string.&lt;br /&gt;&lt;br /&gt; Now in the .aspx.cs file under  Page_Load  method you need to write the following the code&lt;br /&gt;&lt;br /&gt;If(!IsPostBack)&lt;br /&gt;    {&lt;br /&gt;             string  str = “select country_id , name from Country”;&lt;br /&gt;             Datatable  dt  =  Databinding.Execute(str);&lt;br /&gt;             dpdcountry.DataValueField  =  dt.columns[0].ToString();&lt;br /&gt;             dpacountry.DataTextField    =   dt.cloumns[1].ToString();&lt;br /&gt;             dpdcountry.DataSource  =  dt;&lt;br /&gt;             dpdcountry.DataBind();&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On a whole,  first we declared a dropdownlist with the name dpdcountry in the .aspx page. Then in .aspx.cs page, in the Page_Load method  we are sending the sql string to the class Databinding which connects to the database and returns the data table containg the country names. Then this data table is assigned to the dropdownlist as its datasource. So, when you run this code you get a page with the dropdownlist populated with country names.&lt;br /&gt; Note:&lt;br /&gt;1.   You should add the Class Library name in the Referrences of the Project&lt;br /&gt;2.   You should use the  Class Library name in the directories part of the .aspx.cs page&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-3093403705770391198?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/3093403705770391198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=3093403705770391198' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/3093403705770391198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/3093403705770391198'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/08/binding-data-to-dropdownlist-from.html' title='Binding Data to Dropdownlist from Database'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-8230747361224921365</id><published>2009-08-06T08:16:00.000-07:00</published><updated>2009-08-06T08:28:20.313-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# Interview Questions'/><title type='text'>C# InterviewQuestions-Part 10</title><content type='html'>Interview Questions&lt;br /&gt;----------------------&lt;br /&gt;91.  How many types of errors are there?&lt;br /&gt;a ) 2 types&lt;br /&gt;1. Run time errors&lt;br /&gt;2. Compile time errors&lt;br /&gt;&lt;br /&gt;92.  Give some examples of compile time and runtime errors?&lt;br /&gt;a )&lt;strong&gt;  Compile time:&lt;br /&gt;&lt;/strong&gt;missing semocolons&lt;br /&gt;use of undeclared variables&lt;br /&gt;bad references to objects&lt;br /&gt;&lt;strong&gt;runtime:&lt;br /&gt;&lt;/strong&gt;dividing an integer by zero&lt;br /&gt;using negative size for an array&lt;br /&gt;passing a parameter that is not in a valid range&lt;br /&gt;&lt;br /&gt;93.  What is an exception?&lt;br /&gt;a ) An exception is a condition that occurs by a run time error in the program&lt;br /&gt;&lt;br /&gt;94.  What is the base class used for all the exceptions in c#?&lt;br /&gt;a )  It is Exception&lt;br /&gt;&lt;br /&gt;95.  Why do we use throw keyword?&lt;br /&gt;a ) Throw keyword is used to throw our own exceptions.&lt;br /&gt;&lt;br /&gt;96.  How many exceptions we can write in throws clause?&lt;br /&gt;a ) We can use multiple exceptions.&lt;br /&gt;&lt;br /&gt;97.  Can a finally block exists with try block but without a catch block?&lt;br /&gt;a ) Yes&lt;br /&gt;&lt;br /&gt;98.  Can we have nested try blocks in c#?&lt;br /&gt;a ) yes&lt;br /&gt;&lt;br /&gt;99.  What is the difference between Write() and WriteLine() methods?&lt;br /&gt;a ) Write() method outputs one or more values to the screen without a newline character&lt;br /&gt;WriteLine() method outputs one or more values to the screen with a newline character&lt;br /&gt;&lt;br /&gt;100.  What is the difference between Read() and Readline() methods?&lt;br /&gt;a ) Read() method returns a single character as int&lt;br /&gt;ReadLine() method returns a string containing a line of text&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-8230747361224921365?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/8230747361224921365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=8230747361224921365' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/8230747361224921365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/8230747361224921365'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/08/c-interviewquestions-part-10.html' title='C# InterviewQuestions-Part 10'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-77670204465788034</id><published>2009-07-13T11:15:00.000-07:00</published><updated>2009-07-13T11:19:29.494-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# Interview Questions'/><title type='text'>C# InterviewQuestions- Part 9</title><content type='html'>81. why we use the ref keyword?&lt;br /&gt;a ) If you want to pass a parameter by reference you should use the keyword ref&lt;br /&gt;&lt;br /&gt;82.  If an out parameter is not assigned a value with in the body of the function does that method complile?&lt;br /&gt;a )  No. it won't compile&lt;br /&gt;&lt;br /&gt;83.  How can you make write a read only property?&lt;br /&gt;a )  A property can made a read only by omitting the set accessor from the property defination.&lt;br /&gt;&lt;br /&gt;84.  When a static constructor is executed?&lt;br /&gt;a )  It is executed when the class is loaded.&lt;br /&gt;&lt;br /&gt;85.   How many preprocessor directives exists in c#?&lt;br /&gt;a )  They are #define,  #undef, #if, #elif, #else, #endif, #error, #warning, #region, #endregion,  #pragma etc&lt;br /&gt;&lt;br /&gt;86.  When an instance constructor is executed?&lt;br /&gt;a )  It is executed when an instance is created.&lt;br /&gt;&lt;br /&gt;87.   Where you can assign values to a read only field?&lt;br /&gt;a )   We can assign inside a constructor&lt;br /&gt;&lt;br /&gt;88.   Why we use the sixeof operator?&lt;br /&gt;a )   If we want to know the size of any data type you can use sizeof operator.&lt;br /&gt;&lt;br /&gt;89.   What are the disadvantages of distructors in c#?&lt;br /&gt;a )   1. They are non deterministic. means there is no way to know when an object's destructor will actually execute.&lt;br /&gt;2. Implementation of destructor delays the final removal of an object from memory. means objects that have destructors are removed in 2 passes. in the 1st pass only the destructor will be called with out removing object and then  the 2nd pass removes the object, which is time taking and which may effect the performance.&lt;br /&gt;&lt;br /&gt;90.  What is the default access modifier of  an interface members?&lt;br /&gt;a)    public&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-77670204465788034?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/77670204465788034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=77670204465788034' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/77670204465788034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/77670204465788034'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/07/c-interview-questions-part-9.html' title='C# InterviewQuestions- Part 9'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-4211604313512218199</id><published>2009-07-02T09:06:00.000-07:00</published><updated>2009-07-02T09:10:48.206-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# Interview Questions'/><title type='text'>C# InterviewQuestions- Part 8</title><content type='html'>Interview Questions&lt;br /&gt;-----------------------------&lt;br /&gt;&lt;br /&gt;71.  Can we declare an abstract method in non abstract class?&lt;br /&gt;a )   No. it can declared only in abstract classes&lt;br /&gt;&lt;br /&gt;72.  Can we use static or virtual keywords to an abstract method?&lt;br /&gt;a )   No&lt;br /&gt;&lt;br /&gt;73.  Can an interface extend a class?&lt;br /&gt;a )   No.  it can’t extend classes.&lt;br /&gt;&lt;br /&gt;74.  Is it necessary that the direct base class of a derived class must be at least as accessible as the derived class itself?&lt;br /&gt;a )  Yes.&lt;br /&gt;&lt;br /&gt;75.  What is the keyword that is used to invoke the constructor method of the super class?&lt;br /&gt;a )   It is the keyword   “base”.&lt;br /&gt;&lt;br /&gt;76.  What is an enumeration?&lt;br /&gt;a )   An enumeration is a user-defined integer type which provides a way for attaching names to numbers.&lt;br /&gt;&lt;br /&gt;77.  What is boxing?&lt;br /&gt;a )   Conversion of value type to object type (reference type) is known as boxing&lt;br /&gt;&lt;br /&gt;78.  What is unboxing?&lt;br /&gt;a )   Conversion of object type to value type is known as unboxing.&lt;br /&gt;&lt;br /&gt;79.  What are the categories of variables that are automatically initialized to their default values?&lt;br /&gt;a )   They are&lt;br /&gt;1.       Static variables&lt;br /&gt;2.       Instance variables&lt;br /&gt;3.      Array elements&lt;br /&gt;&lt;br /&gt;80.  What is the scope of a variable?&lt;br /&gt;a )   Scope of a variable is the region of code with in which the variable can be accessed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-4211604313512218199?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/4211604313512218199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=4211604313512218199' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/4211604313512218199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/4211604313512218199'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/07/c-interviewquestions-part-8.html' title='C# InterviewQuestions- Part 8'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-782057790442568984</id><published>2009-06-23T08:44:00.000-07:00</published><updated>2009-06-23T08:49:04.757-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# Interview Questions'/><title type='text'>C# InterviewQuestions- Part 7</title><content type='html'>Interview Questions&lt;br /&gt;----------------------------&lt;br /&gt;61. Can private virtual methods be overridden ?&lt;br /&gt;a ) No.   we can not access private methods in inherited classes.&lt;br /&gt;&lt;br /&gt;62. Can we inherit multiple interfaces?&lt;br /&gt;a ) yes. In c# multiple inheritance is achieved through interfaces.&lt;br /&gt;&lt;br /&gt;63.How can a method be overloaded?&lt;br /&gt;a ) a method can be overloaded by creating a method with the same name but with different parameter order, data types and number&lt;br /&gt;&lt;br /&gt;64.  Will finally block get executed if the exception had not occurred?&lt;br /&gt;a )   Yes.  Finally block always gets executed regardless of an error.&lt;br /&gt;&lt;br /&gt;65.  Can multiple catch blocks be executed ?&lt;br /&gt;a )  No. once the appropriate catch code is fired control transfer to the finally block then continues with the rest of the code.&lt;br /&gt;&lt;br /&gt;66.  What is the accessibility level of a protected variable?&lt;br /&gt;a )  It is available to the classes in the same name space.&lt;br /&gt;&lt;br /&gt;67.  Can you override private virtual methods&lt;br /&gt;a )  No.&lt;br /&gt;&lt;br /&gt;68.  Can we inherit multiple interfaces?&lt;br /&gt;a)   Yes. We can’t inherit multiple classes but we can inherit multiple interfaces.&lt;br /&gt;&lt;br /&gt;69.  Can we use virtual keyword to a destructor?&lt;br /&gt;a )   No&lt;br /&gt;&lt;br /&gt;70. What is the access level of a internal variable?&lt;br /&gt;a )    current assembly&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-782057790442568984?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/782057790442568984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=782057790442568984' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/782057790442568984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/782057790442568984'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/06/c-interviewquestions-part-7.html' title='C# InterviewQuestions- Part 7'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-2284459845664078325</id><published>2009-06-10T13:04:00.000-07:00</published><updated>2009-06-10T13:11:02.877-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# Interview Questions'/><title type='text'>C# InterviewQuestions- Part 6</title><content type='html'>Interview Questions&lt;br /&gt;---------------------------&lt;br /&gt;51. What are the types of strings?&lt;br /&gt;a )  2 types&lt;br /&gt;1. mutable strings&lt;br /&gt;2. immutable strings&lt;br /&gt;&lt;br /&gt;52. Is a string is a reference type or value type?&lt;br /&gt;a )  A string is reference type&lt;br /&gt;&lt;br /&gt;53.  What do you mean by mutable and immutable ?&lt;br /&gt;a )  Mutable means we can alter the characters contained in them.&lt;br /&gt;Immutable means that we can not alter the characters contained in them&lt;br /&gt;&lt;br /&gt;54. What are String and StringBuilder classes?&lt;br /&gt;a )  String class is an immutable class and&lt;br /&gt;StringBuilder class is an mutable class&lt;br /&gt;&lt;br /&gt;55. Tell me some methods present in StringBuilder class?&lt;br /&gt;a )  They are&lt;br /&gt;Append(),&lt;br /&gt;Insert(),&lt;br /&gt;Remove(),&lt;br /&gt;Replace(),&lt;br /&gt;appendFormat()&lt;br /&gt;&lt;br /&gt;56.  What is the namespace of StringBuilder class?&lt;br /&gt;a )   System.Text&lt;br /&gt;&lt;br /&gt;57.  Tell me some methods present in String class?&lt;br /&gt;a )  They are&lt;br /&gt;Copy(),&lt;br /&gt;Equals(),&lt;br /&gt;ConCat(),&lt;br /&gt;Compare(),&lt;br /&gt;Trim(),&lt;br /&gt;Substring(),&lt;br /&gt;&lt;br /&gt;58. Can you store multiple data types in System.Array ?&lt;br /&gt;a )  No.&lt;br /&gt;&lt;br /&gt;59. What is the class from which an array is created(derived) automatically in c#&lt;br /&gt;a )  System.Array&lt;br /&gt;&lt;br /&gt;60. Some common methods of System.Array class?&lt;br /&gt;a )  Clear(), CpoyTo(), GetValue(), Sort(), Reverse() etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-2284459845664078325?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/2284459845664078325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=2284459845664078325' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/2284459845664078325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/2284459845664078325'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/06/c-interviewquestions-part-6.html' title='C# InterviewQuestions- Part 6'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-7071230873775603916</id><published>2009-03-09T04:26:00.000-07:00</published><updated>2009-03-09T04:27:22.466-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# Interview Questions'/><title type='text'>C# InterviewQuestions- Part 5</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;41.&lt;span style=""&gt;   &lt;/span&gt;How can we achieve multiple &lt;span style=""&gt; &lt;/span&gt;inheritance in c#?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;a )   Using interfaces.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;42.&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;An interface is a value type or reference type?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;a )    An interface is a reference type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;43.&lt;span style=""&gt;    &lt;/span&gt;Does an interface extend classes?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;a )    No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;44.&lt;span style=""&gt;    &lt;/span&gt;Can we write constructors and destructors for an interface?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;a )  No. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;45.&lt;span style=""&gt;    &lt;/span&gt;What are the default modifiers of members of an interface?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;a )    Public and abstract&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;46.&lt;span style=""&gt;    &lt;/span&gt;What are the differences between an abstract class and an interface?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;a )  &lt;span style="font-style: italic;"&gt;Abstract class&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;1.&lt;span style=""&gt;  &lt;/span&gt;it can contain implementation to some methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;2.&lt;span style=""&gt;  &lt;/span&gt;we can apply access modifiers to one or more methods in an abstract class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;3.&lt;span style=""&gt;  &lt;/span&gt;a class can not inherit more than one abstract class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;4.&lt;span style=""&gt;  &lt;/span&gt;an abstract class can have fields and constants defined&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;&lt;span style="font-style: italic;"&gt;Interface&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;1.&lt;span style=""&gt;  &lt;/span&gt;it just contains declarations. No implementation for any method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;2.&lt;span style=""&gt;  &lt;/span&gt;we can not apply access modifiers to methods inside an interface&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;3.&lt;span style=""&gt;  &lt;/span&gt;a class can inherit more than one interface&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;4.&lt;span style=""&gt;  &lt;/span&gt;interface does not contain any field definition.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;47.&lt;span style=""&gt;    &lt;/span&gt;Can an interface is implemented by any number of classes?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;a )   Yes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;48.&lt;span style=""&gt;    &lt;/span&gt;What are the types of polymorphism?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;a )   2 types&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;1. operation polymorphism&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;2. inclusion polymorphism&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;49.&lt;span style=""&gt;    &lt;/span&gt;How we achieve operation polymorphism and inclusion polymorphism?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;a )   Operation polymorphism is achieved using overloaded methods and operators&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;And inclusion polymorphism is achieved using virtual functions.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Georgia;"&gt;50.  what do you mean by compile time polymorphism?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;span style="font-size: 12pt; font-family: Georgia;"&gt;a )   It is a process of selecting and binding the appropriate method to the object for a particular call at compile time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-7071230873775603916?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/7071230873775603916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=7071230873775603916' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/7071230873775603916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/7071230873775603916'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/03/c-interviewquestions-part-5_09.html' title='C# InterviewQuestions- Part 5'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-7573724414115778832</id><published>2009-03-02T10:19:00.000-08:00</published><updated>2009-03-02T10:24:18.620-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# Interview Questions'/><title type='text'>C# InterviewQuestions- Part 4</title><content type='html'>Interview Questions&lt;br /&gt;---------------------------&lt;br /&gt;31.   What are the inheritance types?&lt;br /&gt;a )  1.  single level inheritance&lt;br /&gt;2.  multi level inheritance&lt;br /&gt;3.  multiple inheritance&lt;br /&gt;4.  hierarchical inheritance&lt;br /&gt;&lt;br /&gt;32.  Can we inherit  the private members of a class&lt;br /&gt;a )   Yes.  But they are not accessible.&lt;br /&gt;&lt;br /&gt;33.   Why we use the keyword virtual?&lt;br /&gt;a )   When you want to override a method of  base class in derived class you should use this virtual keyword to the method in base class&lt;br /&gt;&lt;br /&gt;34.   Why we use override keyword?&lt;br /&gt;a )   When you want to override a method of  base class in derived class you should use this override  keyword to the method in derived  class&lt;br /&gt;&lt;br /&gt;35.   What are the abstract classes?&lt;br /&gt;a )   Abstract classes are the classes for which we can not create objects. Means an abstract class can not be instantiated.&lt;br /&gt;&lt;br /&gt;36.   What are abstract methods?&lt;br /&gt;a )   Abstract methods are the methods which does not contain their body part means they does not provide any implementation.&lt;br /&gt;&lt;br /&gt;37.    What are the properties of abstract methods?&lt;br /&gt;a )    1. they do not contain body part.&lt;br /&gt;2. their definition/implementation should be given in non-abstract classes by overriding that method.&lt;br /&gt;3. we can not use static modifier to it.&lt;br /&gt;&lt;br /&gt;38.    What are the sealed classes?&lt;br /&gt;a )    If you want to prevent a class from being inherited you can use this keyword sealed to that particular class&lt;br /&gt;&lt;br /&gt;39.    What are sealed methods?&lt;br /&gt;a )    A sealed method is a method which can not be overridden by its derived class.&lt;br /&gt;&lt;br /&gt;40.    Does a sealed class is an abstract class? Why?&lt;br /&gt;a )    No a sealed class is not an abstract class. Because we can’t inherit a sealed class but we can inherit an abstract class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-7573724414115778832?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/7573724414115778832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=7573724414115778832' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/7573724414115778832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/7573724414115778832'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/03/c-interviewquestions-part-4.html' title='C# InterviewQuestions- Part 4'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-2457374051805987465</id><published>2009-02-23T10:15:00.000-08:00</published><updated>2009-02-23T10:32:05.196-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# Interview Questions'/><title type='text'>C# InterviewQuestions- Part 3</title><content type='html'>Interview Questions&lt;br /&gt;--------------------------&lt;br /&gt;&lt;br /&gt;21. What are the properties of constant members?&lt;br /&gt;a ) 1. They should use the modifier ‘ const’&lt;br /&gt;2. Their value should be given when they are defined (it can’t be changed later)&lt;br /&gt;3. They are implicitly static.&lt;br /&gt;&lt;br /&gt;22. Why we use this keyword?&lt;br /&gt;a )  This is used to distinguish local and instant variables that have the same name.&lt;br /&gt;&lt;br /&gt;23. Does a copy of a static variable is created every time a class is instantiated?&lt;br /&gt;a )  No.&lt;br /&gt;&lt;br /&gt;24. What is a partial class?&lt;br /&gt;a )  A partial class is a class which resides in multiple files. It should use 'partial' keyword. Generally it is used in situations where multiple developers need acess to the same class.&lt;br /&gt;&lt;br /&gt;25. What is the name of the class from which all .net classes are derived?&lt;br /&gt;a )  System.Object&lt;br /&gt;&lt;br /&gt;26. Does c# support global variables?&lt;br /&gt;a )  No. all declarations must be done inside a class.&lt;br /&gt;&lt;br /&gt;27.  Differences between property and indexer?&lt;br /&gt;a ) &lt;em&gt;Property&lt;br /&gt;&lt;/em&gt;A property can be static member&lt;br /&gt;The get accessor of a property corresponds to a method with no parameters&lt;br /&gt;&lt;em&gt;Indexer&lt;br /&gt;&lt;/em&gt;An indexer is always an instant member&lt;br /&gt;The get accessor of an indexer corresponds to the same formal parameter list as the indexer.&lt;br /&gt;&lt;br /&gt;28.  Differences between overloading and overriding?&lt;br /&gt;a ) &lt;em&gt;Overloading&lt;br /&gt;&lt;/em&gt;1. used we want a method with more than one definition with in the same scope&lt;br /&gt;2. in overloading, methods will have same name but different number, types, order of arguments.&lt;br /&gt;&lt;em&gt;Overriding&lt;br /&gt;&lt;/em&gt;1. this is used when we have parent, child classes.&lt;br /&gt;2. in overriding , methods will have same name with same arguments and same return type.&lt;br /&gt;&lt;br /&gt;29.  what is the order of the constructor execution in inheritance?&lt;br /&gt;a )  They are executed from top(parent class) to bottom(child class)&lt;br /&gt;&lt;br /&gt;30. what is the order of the destructors execution in inheritance?&lt;br /&gt;a )  They are executed from bottom(child class) to top(parent/base class)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-2457374051805987465?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/2457374051805987465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=2457374051805987465' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/2457374051805987465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/2457374051805987465'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/02/c-interviewquestions-part-3.html' title='C# InterviewQuestions- Part 3'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-5886612839395475648</id><published>2009-02-16T10:50:00.000-08:00</published><updated>2009-02-16T10:55:39.207-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# Interview Questions'/><title type='text'>C# InterviewQuestions- Part 2</title><content type='html'>Interview Questions&lt;br /&gt;---------------------------&lt;br /&gt;&lt;br /&gt;11.  Can we use access modifier on static constructor?&lt;br /&gt;a )   No&lt;br /&gt;&lt;br /&gt;12.  How many static constructors we can declare for a single class?&lt;br /&gt;a )   A class can have only one static constructor.&lt;br /&gt;&lt;br /&gt;13.  What is method overloading?&lt;br /&gt;a )   It is a process of creating methods that have the same name but  with different parameter lists and different definitions. This method overloading is used when you want your methods to do same tasks but using different input parameters.&lt;br /&gt;&lt;br /&gt;14.  What happens when we use ‘private’  modifier to a constructor of a class?&lt;br /&gt;a )   When we declare a constructor of a class as private then we can’t create a objects of that class and we can not use that class as a base class for inheritance&lt;br /&gt;&lt;br /&gt;15.  Can we overload constructors?&lt;br /&gt;a )   Yes&lt;br /&gt;&lt;br /&gt;16.  What are instant variables?&lt;br /&gt;a )  Class variables are known as instant variables.  Instant variables are different for each object and they are accessed using the objects. When ever a class is instantiated a new copy of the each of the instant variable is created.&lt;br /&gt;&lt;br /&gt;17.  What are static variables?&lt;br /&gt;a )  These are also known as class variables. Static variables are common for all objects of a class. Only one copy of static variables will be created for all the objects of a class.&lt;br /&gt;&lt;br /&gt;18.  What are the differences between structure and class&lt;br /&gt;a )   &lt;em&gt;Structure:&lt;br /&gt;&lt;/em&gt;It is value type&lt;br /&gt;It is stored on stack&lt;br /&gt;Does not support inheritance&lt;br /&gt;Suitable for small data structure&lt;br /&gt;&lt;em&gt;Class:&lt;br /&gt;&lt;/em&gt;It is reference type&lt;br /&gt;It is stored on heap&lt;br /&gt;Supports inheritance&lt;br /&gt;Suitable for complex data structures&lt;br /&gt;&lt;br /&gt;19.  What is a value type? Give examples&lt;br /&gt;a )   It stores value directly. Value types are stored on stack. Separate memory will be given for each instant of a value type.&lt;br /&gt;Ex:  int, float, char, struct&lt;br /&gt;&lt;br /&gt;20.  What are reference type?&lt;br /&gt;a )   It stores a reference to the value. They are stored on heap.&lt;br /&gt;Ex: class, string, array.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-5886612839395475648?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/5886612839395475648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=5886612839395475648' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/5886612839395475648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/5886612839395475648'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/02/c-interviewquestions-part-2.html' title='C# InterviewQuestions- Part 2'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-5389314053082350735</id><published>2009-02-10T13:53:00.000-08:00</published><updated>2009-02-12T15:18:38.438-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# Interview Questions'/><title type='text'>C# InterviewQuestions- Part 1</title><content type='html'>Interview Questions&lt;br /&gt;------------------------&lt;br /&gt;&lt;br /&gt;1. What are the main properties of object oriented programming?&lt;br /&gt;a ) There are mainly 3 properties&lt;br /&gt;1. Encapsulation/Abstraction&lt;br /&gt;2. Inheritance&lt;br /&gt;3. Polymorphism&lt;br /&gt;&lt;br /&gt;2. What is encapsulation?&lt;br /&gt;a ) This gives a way to hide the internal details of an object from its users.&lt;br /&gt;&lt;br /&gt;3. What is inheritance ?&lt;br /&gt;a ) It provides a way to build/create new classes using existing classes.&lt;br /&gt;&lt;br /&gt;4. What is polymorphism?&lt;br /&gt;a ) It provides a way to take more than one form.&lt;br /&gt;&lt;br /&gt;5. What is a constructor?&lt;br /&gt;a ) Constructor enables an object to initialize itself when it is first created.&lt;br /&gt;&lt;br /&gt;6. What are the properties of a constructor?&lt;br /&gt;a ) They are&lt;br /&gt;1. They should have the same name as that of a class&lt;br /&gt;2. They do not specify a return type.&lt;br /&gt;3. we can use access modifiers to constructor.&lt;br /&gt;&lt;br /&gt;7. How many types of access modifiers are there ?&lt;br /&gt;a ) 5 types&lt;br /&gt;1. Private&lt;br /&gt;2. Public&lt;br /&gt;3. Protected&lt;br /&gt;4. Internal&lt;br /&gt;5. Protected Internal&lt;br /&gt;&lt;br /&gt;8. What access modifiers we can use for a class?&lt;br /&gt;a ) We can use 2 access modifiers&lt;br /&gt;1. Public&lt;br /&gt;2. Internal&lt;br /&gt;&lt;br /&gt;9. What is the default access modifier of a class?&lt;br /&gt;a ) It is &lt;span style="FONT-WEIGHT: bold"&gt;Internal&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;10. What is the default access modifier for class members?&lt;br /&gt;a ) It is &lt;span style="FONT-WEIGHT: bold"&gt;Private&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-5389314053082350735?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/5389314053082350735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=5389314053082350735' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/5389314053082350735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/5389314053082350735'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/02/c-interview-questions-part-1.html' title='C# InterviewQuestions- Part 1'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-8426403012232252480</id><published>2009-02-03T10:16:00.000-08:00</published><updated>2009-02-12T15:37:41.819-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataBase Connection'/><title type='text'>DataSet</title><content type='html'>Filling dataset with data from more than one table&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;To Fill dataset with data from more than one table from database and to&lt;br /&gt;bind that data to datagrid we need following code&lt;br /&gt;&lt;br /&gt;&lt;em&gt;1. In .aspx file you need to write&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&amp;ltdiv&amp;gt&lt;br /&gt;&amp;ltasp:datagrid id="grid1" runat="server" autogeneratecolumns="True"&amp;gt&lt;br /&gt;&amp;lt/asp:datagrid&amp;gt&lt;br /&gt;&amp;ltasp:datagrid id="grid2" runat="server" autogeneratecolumns="True"&amp;gt&lt;br /&gt;&amp;lt/asp:datagrid&amp;gt&lt;br /&gt;&amp;lt/div&amp;gt&lt;br /&gt;&lt;br /&gt;Here we are specifying 2 datagrids to display data from 2 Tables.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;2. In .aspx.cs file &lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. First we need to open a connection&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;SqlConnection newconn = new SqlConnection(“Server=xxx;&lt;br /&gt;InitialCatalog=xxx; UserId=xx;Password=xxx”);&lt;br /&gt;Newconn.open();&lt;br /&gt;&lt;br /&gt;In the above statement server= xxx means we are specifying server&lt;br /&gt;name.InitialCatalog means database name from which we want to&lt;br /&gt;retrive data. Userid, password are userid and passwords of user&lt;br /&gt;for sql server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Next we need to specify the sql statements(required operation) &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;DataAdapter da = new SqlDataAdapter("select * from firsttablensme;&lt;br /&gt;Select * from secondtablename”, newconn)&lt;br /&gt;&lt;br /&gt;note: here instead of command object we are directly using&lt;br /&gt;DataAdapter.If you want you can use command object also.&lt;br /&gt;&lt;br /&gt;In the above statement we are selecting data from two tables.&lt;br /&gt;Newconn is the connection object.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Now, we need to fill the dataset &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;ds = new DataSet();&lt;br /&gt;da.Fill(ds, “firsttablename”);&lt;br /&gt;da.Fill(ds, “secondtablename”);&lt;br /&gt;&lt;br /&gt;Here we are using Fill() method of dataadapter to fill the Dataset.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Now to bind this data to datagrid we need following code&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;grid1.DataSource = ds;&lt;br /&gt;grid1.DataSource = ds.Tables[0];&lt;br /&gt;grid1.DataBind();&lt;br /&gt;&lt;br /&gt;grid2.DataSource = ds.Tables[1];&lt;br /&gt;grid2.DataBind();&lt;br /&gt;&lt;br /&gt;Here DataSource property represents the datasource of the datagrid and&lt;br /&gt;DataBind() method used to bind data to the datagrid.&lt;br /&gt;&lt;br /&gt;Note: you can also use caption property of datagrid to specify the table caption&lt;br /&gt;Ex: grid1.caption = “xxx”&lt;br /&gt;here Xxx represents cation for the table displayed by datagrid.&lt;br /&gt;&lt;br /&gt;That’s it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-8426403012232252480?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/8426403012232252480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=8426403012232252480' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/8426403012232252480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/8426403012232252480'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/02/dataset.html' title='DataSet'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-6941239296719711631</id><published>2009-01-27T11:21:00.000-08:00</published><updated>2009-02-12T15:35:33.682-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataBase Connection'/><title type='text'>Filling data from Database in to Dataset and then to Datagrid</title><content type='html'>LOADING DATA FROM DATABASE IN TO DATASET AND BINDING IT TO DATAGRID&lt;br /&gt;---------------------------------------------------------------------------------&lt;br /&gt;Dataset can not directly retrieve data from database. For this purpose we should use DataAdapter. DataAdapter acts as a bridge between database and dataset. This is used to retrieve data from Database into Dataset as well as to Update Database through Dataset.It supports insert, delete, update, select operations. It supports disconnected model.&lt;br /&gt;&lt;br /&gt;Now we will see the steps required to fill data from database into dataset and then populate that data into datagrid.&lt;br /&gt;For that&lt;br /&gt;&lt;br /&gt;In .aspx page, in &amp;ltdiv&amp;gt section we should write&lt;br /&gt;&amp;ltdiv&amp;gt&lt;br /&gt;&amp;ltasp:datagrid id="exdatagrid" autogeneratecolumns="true" runat="server"&amp;gt&lt;br /&gt;&amp;lt/asp:datagrid&amp;gt&lt;br /&gt;&amp;lt/div&amp;gt&lt;br /&gt;&lt;br /&gt;Here ID represents the id of the datagrid, runat represents that the datagrid is a server control, AutoGenerateColumns automatically creates the columns for the datagrid.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;In the .aspx.cs file&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;strong&gt;1. First we should open a connection&lt;br /&gt;&lt;/strong&gt;SqlConnection newconn = new SqlConnection(“Server=xxx;InitialCatalog=xxx;&lt;br /&gt;UserId=xx;Password=xxx”);&lt;br /&gt;Newconn.open();&lt;br /&gt;&lt;br /&gt;In the above statement server = xxx means we are specifying server name. InitialCatalog means database name from which we want to retrive data. Userid, password are userid and passwords of user for sql server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Next we need to specify the sql statement(required operation)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;SqlCommand cmd = new SqlCommand(“select * from xxx”, newconn);&lt;br /&gt;&lt;br /&gt;In this statement first argument specifies the sql select statement(required operation) and second statement specifies the connection object. Here xxx represents Table name in database.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3 Now, we need to declare the DataAdapter&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;SqlDataAdapter da = new SqlDataAdapter(cmd);&lt;br /&gt;&lt;br /&gt;In this statement dataadapter contains the command object as its argument to perform the required operation.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Now, we need to fill the dataset&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;ds = new DataSet();&lt;br /&gt;da.Fill(ds);&lt;br /&gt;&lt;br /&gt;In these statements first we declare dataset and then using the Fill() method of dataadapter we fill the dataset with the data from Database.&lt;br /&gt;&lt;br /&gt;so now dataset is filled with the data from database.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Now we fill datagrid with the information/data in the dataset&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;exdatagrid.DataSource = ds;&lt;br /&gt;exdatagrid.DataBind();&lt;br /&gt;&lt;br /&gt;Here exdatagrid is the id of the datagrid we have declared in .aspx page.&lt;br /&gt;DataSource property represents the datasource(means dataset) for the datagrid. DataBind method is used to bind data to the datagrid.&lt;br /&gt;&lt;br /&gt;That’s it. We will see the data populated in to the datagrid.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-6941239296719711631?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/6941239296719711631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=6941239296719711631' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/6941239296719711631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/6941239296719711631'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/01/filling-data-from-database-in-to.html' title='Filling data from Database in to Dataset and then to Datagrid'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-7029908213268396867</id><published>2009-01-20T11:43:00.000-08:00</published><updated>2009-02-12T15:18:14.382-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net Interview Questions'/><title type='text'>Interview Questions - Part 10</title><content type='html'>Interview Questions&lt;br /&gt;--------------------------&lt;br /&gt;&lt;br /&gt;96. What is a TreeView Server control ?&lt;br /&gt;a ) This is a site navigation control. It displays the data in hierarchical order. Generally is is used to display Menu items for an application. It contains a number of prebuilt styles.&lt;br /&gt;&lt;br /&gt;97. What are the differences between viewstate and hidden fields?&lt;br /&gt;a ) &lt;em&gt;Viewstate :&lt;/em&gt;&lt;br /&gt;1. This is used for pages that will postback to itself&lt;br /&gt;2. This is a built in structure for maintaining state of a page&lt;br /&gt;3. Security is more as data is hashed, compressed and encoded.&lt;br /&gt;&lt;em&gt;Hiddenfield :&lt;/em&gt;&lt;br /&gt;1. This is used for pages that will postback to itself or to another page&lt;br /&gt;2. This is not an inbuilt structure&lt;br /&gt;3. Security is less when compared to viewstate&lt;br /&gt;&lt;br /&gt;98. Examples of Navigation controls?&lt;br /&gt;a ) They are&lt;br /&gt;1. TreeView Control&lt;br /&gt;2. Menu&lt;br /&gt;3. SiteMapPath&lt;br /&gt;&lt;br /&gt;99. What is the namespace used for web page&lt;br /&gt;a ) System.Web.UI.Page&lt;br /&gt;&lt;br /&gt;100. What is the use of IsPostBack method?&lt;br /&gt;a ) This method is to determine whether request is new request or postback request.&lt;br /&gt;&lt;br /&gt;101. What are the advantages of DataGrid Control?&lt;br /&gt;a )&lt;br /&gt;1. Inbuilt support for paging and sorting&lt;br /&gt;2. Inbuilt support for user selection and editing&lt;br /&gt;3. Contains its default display&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-7029908213268396867?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/7029908213268396867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=7029908213268396867' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/7029908213268396867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/7029908213268396867'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/01/interview-questions-part-10.html' title='Interview Questions - Part 10'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-1062205709396212058</id><published>2009-01-14T09:06:00.000-08:00</published><updated>2009-02-12T15:17:52.404-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net Interview Questions'/><title type='text'>Interview Questions - Part 9</title><content type='html'>Interview Questions&lt;br /&gt;--------------------------&lt;br /&gt;86. What is caching?&lt;br /&gt;a ) This allows a way to keep most frequently used data in memory to increase the performance of the application.&lt;br /&gt;&lt;br /&gt;87. What are the types of page output cache?&lt;br /&gt;a ) This is used to store the contents of a processed page in memory.&lt;br /&gt;It is devided in to 2 types&lt;br /&gt;1. full page caching&lt;br /&gt;it stores the entire contents of a page&lt;br /&gt;2. partial page caching&lt;br /&gt;it stores the parts of a page.&lt;br /&gt;&lt;br /&gt;88. What do you mean by post-cache substitution?&lt;br /&gt;a ) This is one type of partial page caching. It allows you to cache the entire page but parts of a page are not cached means they will be created dynamically.&lt;br /&gt;&lt;br /&gt;89. When the items will be removed from the cache?&lt;br /&gt;a ) Items from cache are removed&lt;br /&gt;1. when memory runs low&lt;br /&gt;2. when an item expires&lt;br /&gt;3. when items dependency changes&lt;br /&gt;&lt;br /&gt;90. What is Sliding expiration?&lt;br /&gt;a ) Suppose an item is placed in cache and its sliding expiration is 10 minutes. Then this sliding expiration policy specifies that the item stored in cache will be removed after 10 min from the time it is last used/accessed.&lt;br /&gt;&lt;br /&gt;91. What is Absolute expiration?&lt;br /&gt;a ) Suppose an item is placed in cache and its absolute expiration is 5 pm. Then this absolute expiration policy specifies that the item will be removed from the cache after 5 pm.&lt;br /&gt;&lt;br /&gt;92. What is the directive used to implement caching in a page?&lt;br /&gt;a ) It is @OutputCache&lt;br /&gt;&lt;br /&gt;93. What is the attribute used to set the expiration of an item in the cache?&lt;br /&gt;a ) It is “Duration” attribute&lt;br /&gt;&lt;br /&gt;94. What are the attributes of outputcache used to store multiple versions of a page?&lt;br /&gt;a )&lt;br /&gt;1. VaryByParam&lt;br /&gt;Using querystring it enables you to cache multiple versions of a page&lt;br /&gt;2. varyByControl&lt;br /&gt;Using a control value it enables you to cache multiple versions of a page&lt;br /&gt;3. VaryByHeader&lt;br /&gt;Using requests http header it enables you to cache multiple versions of a page&lt;br /&gt;4. VaryByCustom&lt;br /&gt;Using custom string or browser type it enables you to cache multiple versions of a page&lt;br /&gt;&lt;br /&gt;95. what is sql dependency in caching?&lt;br /&gt;a ) Means an item in the cache depends on the changes in a table in sql Database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-1062205709396212058?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/1062205709396212058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=1062205709396212058' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/1062205709396212058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/1062205709396212058'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/01/inerview-questions-part-9.html' title='Interview Questions - Part 9'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-4608124009525149053</id><published>2009-01-10T13:41:00.000-08:00</published><updated>2009-02-12T15:17:33.411-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net Interview Questions'/><title type='text'>Interview  Questions - Part 8</title><content type='html'>Interview Questions&lt;br /&gt;---------------------------&lt;br /&gt;&lt;br /&gt;76. What is the life time of the data stored in viewstate?&lt;br /&gt;a ) Data stored in viewstate exists for the life of the current page.&lt;br /&gt;&lt;br /&gt;77. Can a masterpage contain multiple content areas?&lt;br /&gt;a ) Yes&lt;br /&gt;&lt;br /&gt;78. What does the merge method of dataset do?&lt;br /&gt;a ) It merges the dataset with another dataset.&lt;br /&gt;&lt;br /&gt;79. What is the maximum length of the char datatype?&lt;br /&gt;a ) Char – max of 8000 characters&lt;br /&gt;&lt;br /&gt;80. What is the method used to kill a session explicitly?&lt;br /&gt;a ) Session.abandon method.&lt;br /&gt;&lt;br /&gt;81. What is the extension of the resource files?&lt;br /&gt;a ) .resx&lt;br /&gt;&lt;br /&gt;82. What is the attribute used to apply theme to a specific page?&lt;br /&gt;a ) That is ‘Theme’ attribute.&lt;br /&gt;&lt;br /&gt;83. How many types of configuration files are there?&lt;br /&gt;a ) 2 types&lt;br /&gt;Machine.config: This is a server or machine wide configuration file&lt;br /&gt;Web.config : This is a application configuration file.&lt;br /&gt;&lt;br /&gt;84. What are the advantages of web.config file?&lt;br /&gt;a )&lt;br /&gt;1. This contains application specific configuration settings whichis same for all the pages in that application.&lt;br /&gt;2. This is xml file which is easily readble and understandable.&lt;br /&gt;3. This applies changes to the asp.net application with out need for the administrator to stop and start the webserver.&lt;br /&gt;4. It provides more security as data is encrypted.&lt;br /&gt;&lt;br /&gt;85. Is it possible for an application to have more than one web.config file?&lt;br /&gt;a ) Yes. An application can support more than one web.config file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-4608124009525149053?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/4608124009525149053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=4608124009525149053' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/4608124009525149053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/4608124009525149053'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/01/interview-questions-part-8.html' title='Interview  Questions - Part 8'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-136785003163099035</id><published>2009-01-08T06:54:00.000-08:00</published><updated>2009-02-12T15:17:13.479-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net Interview Questions'/><title type='text'>Interview Questions - Part 7</title><content type='html'>Interview Question&lt;br /&gt;--------------------------&lt;br /&gt;&lt;br /&gt;66. What are the types of Serialization?&lt;br /&gt;a ) 4 types&lt;br /&gt;1. XML Serialization&lt;br /&gt;2. Binary Serialization&lt;br /&gt;3. SOAP Serialization&lt;br /&gt;4. Custom Serialization&lt;br /&gt;&lt;br /&gt;67. What is xml serialization?&lt;br /&gt;a. ) Xml serialization can convert only the public properties and fields of an object in to an xml stream that confirms to a specific xml schema defination language document. Xml serialization is also known as shallow serialization. Xml serialization is used when you nedd the data in the object to stored in xml format. Xml stream can be processed by any application as needed regardless of platform.&lt;br /&gt;&lt;br /&gt;68. What are the 2 methods of xmlserializer class?&lt;br /&gt;a ) 1. serialize&lt;br /&gt;2. deserialize&lt;br /&gt;&lt;br /&gt;69. What is binary serialization?&lt;br /&gt;a ) This is used to convert both public and private properties and fields of an object. This serialization is useful when data needs to travel electronically over wire. Disadvantage of this serialization is it is not easily portable to another platform.&lt;br /&gt;&lt;br /&gt;70. What is SOAP Serialization?&lt;br /&gt;a ) Similar to binary serialization this also convert the public and private properties and fields of an object in to a stream of bytes. This serialization is useful when you need interoperability.&lt;br /&gt;&lt;br /&gt;71. what is satellite assembly?&lt;br /&gt;a) An assembly which contains language specific resouces means culture information is known as satellite assembly.&lt;br /&gt;&lt;br /&gt;72. what are the parts of version number of an assembly?&lt;br /&gt;a) They are major, minor, revision, build.&lt;br /&gt;&lt;br /&gt;73. what are the commands used to insert and remove assemblies in/from global assembly cache?&lt;br /&gt;a) gacutil -I assemblyname /to insert&lt;br /&gt;gacutil -u assemblyname /to uninstall&lt;br /&gt;&lt;br /&gt;74. In which suituations we use gacutil tool?&lt;br /&gt;a) We use it in development scenarios.&lt;br /&gt;&lt;br /&gt;75. what is side-by-side execution?&lt;br /&gt;a) This provides a way to keep multiple versions of an application on the same machine at the same time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-136785003163099035?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/136785003163099035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=136785003163099035' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/136785003163099035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/136785003163099035'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/01/interview-questions-part-7.html' title='Interview Questions - Part 7'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-1898944133285940266</id><published>2009-01-05T10:20:00.000-08:00</published><updated>2009-02-12T15:16:53.918-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net Interview Questions'/><title type='text'>Interview Questions - Part 6</title><content type='html'>Interview Questions&lt;br /&gt;-----------------------------&lt;br /&gt;&lt;br /&gt;56. How can we customise columns in datagrid?&lt;br /&gt;a ) Using the Template column.&lt;br /&gt;&lt;br /&gt;57. What is the character/size limit in query string?&lt;br /&gt;a ) Some browsers impose a 2083 character limit on the length of the URL.&lt;br /&gt;&lt;br /&gt;58. How do you separate business logic while creating on asp.net application?&lt;br /&gt;a ) By using code behind model&lt;br /&gt;&lt;br /&gt;59. How many classes can a single .net dll contain?&lt;br /&gt;a ) It can contain unlimitesd classes.&lt;br /&gt;&lt;br /&gt;60. What is the maximum length of varchar and nchar datatypes?&lt;br /&gt;a ) Varchar - max of 8000 characters&lt;br /&gt;Nchar - max of 4000 characters&lt;br /&gt;&lt;br /&gt;61. What is Portable Executable?&lt;br /&gt;a ) It is a file format defining the structure that all executable files and dynamic link libraries must use to allow them to be loaded and executed by windows.&lt;br /&gt;&lt;br /&gt;62. What is the use of Application Domain?&lt;br /&gt;a ) This provides a way to isolate an application from other applications.&lt;br /&gt;&lt;br /&gt;63. In which folder we store Local Resouce files?&lt;br /&gt;a ) They are specific to a single page. They are stored in App_LocalResorces&lt;br /&gt;&lt;br /&gt;64. What is serialization? What are its advantages?&lt;br /&gt;a ) It provides a way to save the state of an object by converting it into a stream of bytes.&lt;br /&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;br /&gt;1. It provides a way to transportation of an object through a network&lt;br /&gt;2. It provides a way to re create the same object by saving the its state.&lt;br /&gt;&lt;br /&gt;65. What are the disadvantages of serialization?&lt;br /&gt;a )&lt;br /&gt;1. It requires more resources (to convert an object into a stream of bytes)&lt;br /&gt;2. Serialization is a slow process.&lt;br /&gt;3. It involves latency issues for transmitting the data over network.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-1898944133285940266?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/1898944133285940266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=1898944133285940266' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/1898944133285940266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/1898944133285940266'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2009/01/interview-questions-part-6.html' title='Interview Questions - Part 6'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-4443988513793330425</id><published>2008-12-31T10:43:00.000-08:00</published><updated>2009-02-12T15:16:30.888-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net Interview Questions'/><title type='text'>Interview Questions - Part 5</title><content type='html'>Interview Questions&lt;br /&gt;------------------------&lt;br /&gt;&lt;br /&gt;46. What is a command object?&lt;br /&gt;a.) This is used to perform the required operations on the database. A command object contains 2 arguments. First argument specifies the sql statement or stored procedure to be executed on the database and second argument specifies the connection object. First argument, if it is a sql statement, it can be a select, update, insert or delete. If we want to use a stored procedure we should specify its name as the first argument of the command object. Command object is generally used along with the Data Reader.&lt;br /&gt;&lt;br /&gt;47. Why we use ExecuteNonQuery method?&lt;br /&gt;a.) This is the method of the connection object. This is used when you use a stored procedure. This won’t return any data from database, simply executes the procedure.&lt;br /&gt;&lt;br /&gt;48. What is a DataAdapter?&lt;br /&gt;a.) Dataset can’t communicate directly with the database. So, in order to communicate with the database it makes use of DataAdapter. This acts as a bridge between dataset and database. It contains 2 arguments. First argument specifies the sql statement , and 2 argument specifies the connection object. It can perform all the DML operations.&lt;br /&gt;&lt;br /&gt;49. What is the method used by dataadapter to fill the dataset?&lt;br /&gt;a.) It uses Fill() method to fill the dataset with data from database.&lt;br /&gt;&lt;br /&gt;50. what are the differences between datareader and data adapter?&lt;br /&gt;a.) DataReader:&lt;br /&gt;1.It supports connected model&lt;br /&gt;2.It is used to retrive a forward only read only stream of data from data source.&lt;br /&gt;3.performance is more&lt;br /&gt;4.It can not perform insert, delete or update operations&lt;br /&gt;DataAdapter:&lt;br /&gt;1.It supports Disconnected model&lt;br /&gt;2.It acts as a bridge between dataset and database&lt;br /&gt;3.performance is less when compared to datareader&lt;br /&gt;4.It can perform insert, delete and update operations&lt;br /&gt;&lt;br /&gt;51. How many templates are there in Repeater control?&lt;br /&gt;a) 5 Templates are there&lt;br /&gt;1. ItemTemplate&lt;br /&gt;2. AlternatingItemTemplate&lt;br /&gt;3. HeaderTemplate&lt;br /&gt;4. FooterTemplate&lt;br /&gt;5. SeparatorTemplate&lt;br /&gt;&lt;br /&gt;52. What are the disadvantages of Repeater Control?&lt;br /&gt;a )&lt;br /&gt;1. It does not contain predefined layout.&lt;br /&gt;2. It produces readonly output&lt;br /&gt;3. It does not support user selection and editing of data&lt;br /&gt;4. No inbuilt support for paging and sorting&lt;br /&gt;&lt;br /&gt;53. How many templates are there in DataList Control&lt;br /&gt;a ) 7 Templates&lt;br /&gt;1. ItemTemplate&lt;br /&gt;2. AlternatingItemTemplate&lt;br /&gt;3. HeaderTemplate&lt;br /&gt;4. FooterTemplate&lt;br /&gt;5. SeparatorTemplate&lt;br /&gt;6. SelectedItemTemplate&lt;br /&gt;7. EditItemTemplate&lt;br /&gt;&lt;br /&gt;54. What is the use of alternatingItem Template?&lt;br /&gt;a ) This is used to apply alternate color scheme in Datareader and DataList server controls.&lt;br /&gt;&lt;br /&gt;55. How many columns are there in DataGrid Control&lt;br /&gt;a ) 5 columns&lt;br /&gt;1. Bound Column&lt;br /&gt;2. Button Column&lt;br /&gt;3. Edit command column&lt;br /&gt;4. Hyperlink Column&lt;br /&gt;5. Templated Column&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-4443988513793330425?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/4443988513793330425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=4443988513793330425' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/4443988513793330425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/4443988513793330425'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/interview-question-part-5.html' title='Interview Questions - Part 5'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-2324939825307270126</id><published>2008-12-29T10:02:00.000-08:00</published><updated>2009-02-12T15:16:08.477-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net Interview Questions'/><title type='text'>Interview Questions - Part 4</title><content type='html'>Interview Questions&lt;br /&gt;--------------------------------&lt;br /&gt;&lt;br /&gt;36. what are the differences between Ado and Ado.net&lt;br /&gt;a.) &lt;em&gt;Ado:&lt;/em&gt;&lt;br /&gt;1. It supports connected model&lt;br /&gt;2. xml support is less&lt;br /&gt;3. It uses record set&lt;br /&gt;&lt;em&gt;Ado.net&lt;br /&gt;&lt;/em&gt;1. It supports disconnected model&lt;br /&gt;2. xml support is more&lt;br /&gt;3. it uses data set&lt;br /&gt;&lt;br /&gt;37. What are the basic objects needed for Ado.Net&lt;br /&gt;a.) There are 5 main objects.&lt;br /&gt;1. Connection object: used to open a connection to the database&lt;br /&gt;2. command object: used to perform operations on database&lt;br /&gt;3. datareader object: used to read data in forward only read only manner from database&lt;br /&gt;4. DataAdapter: Acts as a bridge between Dataset and Dataset&lt;br /&gt;5. Dtaset: In-Memory container for all your data.&lt;br /&gt;&lt;br /&gt;38. What are the arguments of a connection object?&lt;br /&gt;a.) 1. server : this is used to specify the server name.&lt;br /&gt;2. InitialCatalog: This is used to specify the database name&lt;br /&gt;3. usedID: specifies the user id&lt;br /&gt;4. password: specifies the user password.&lt;br /&gt;&lt;br /&gt;39. Which method is used to release resources on connection object?&lt;br /&gt;a.) Dispose() method.&lt;br /&gt;&lt;br /&gt;40. What are the namespaces required to use Ado.net&lt;br /&gt;a.) System&lt;br /&gt;System.Data&lt;br /&gt;System.Data.SqlClient (or) System.Data.OleDb (OR) system.Data.Odbc (OR) system.Data.OracleClient.&lt;br /&gt;&lt;br /&gt;41. What is a Dataset?&lt;br /&gt;a.) Dataset is a simple, in-memory data store for your data. It contains data, constraints on data, and relationships between data. It supports disconnected model, means connection is opened when the request is made and it closes when request is served with response. It can contain data from more than one table or database.&lt;br /&gt;&lt;br /&gt;42. Why we use AcceptChanges method ?&lt;br /&gt;a.) This is the method used by Dataset to commit the changes done by DML statements.&lt;br /&gt;&lt;br /&gt;43. What is Getchanges method?&lt;br /&gt;a.) This is used to get only those rows which have been modified. This can be used on a datatable or dataset.&lt;br /&gt;&lt;br /&gt;44. What is a DataReader?&lt;br /&gt;a.) DataReader is used to read data in forward only and read only manner.&lt;br /&gt;Read() method is used to read data from database using datareader. They support connected model. Performance is more as they read data in forward only and read only manner. It can’t read data from more than one table at any point of time.&lt;br /&gt;&lt;br /&gt;45. What are the methods we can apply on dataReader?&lt;br /&gt;a.) 1.Read(): used to read&lt;br /&gt;2.Close(): Used to close datareader&lt;br /&gt;3.IsClosed(): used to check whether datareader is closed or not&lt;br /&gt;4.HasRows(): used to check whether there are rows or not&lt;br /&gt;5.NextResult(): with this we can execute a set of sql statements&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-2324939825307270126?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/2324939825307270126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=2324939825307270126' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/2324939825307270126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/2324939825307270126'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/interview-questions_29.html' title='Interview Questions - Part 4'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-1773484370804454372</id><published>2008-12-23T08:19:00.000-08:00</published><updated>2009-02-12T15:15:45.937-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net Interview Questions'/><title type='text'>Interview Questions - Part 3</title><content type='html'>Interview Questions&lt;br /&gt;----------------------------&lt;br /&gt;&lt;br /&gt;26. How many types of assemblies are there?&lt;br /&gt;a. 2 Types.&lt;br /&gt;1. Private assemblies: which are used by only one application and are placed in the application's directory&lt;br /&gt;2. shared assemblies: which are shared by many applications and are placed in machine wide code cache called global assembly cache.&lt;br /&gt;&lt;br /&gt;27. What are main contents of an assembly&lt;br /&gt;a. They are 4 contents&lt;br /&gt;1. assembly manifest&lt;br /&gt;2. Type metadata&lt;br /&gt;3. msil that implements types&lt;br /&gt;4. list of resouces&lt;br /&gt;&lt;br /&gt;28. What is an assembly manifest?&lt;br /&gt;a. Assembly manifest is main part of an assembly. it is used to store information about metadata like version information, security information, types info, scope of assembly etc.&lt;br /&gt;&lt;br /&gt;29. What are the contents of an assembly manifest?&lt;br /&gt;a. It contains name of the assembly,version information, culture information, strongname information, type reference information, list of files in assembly, and list of other assemblies&lt;br /&gt;&lt;br /&gt;30. What is a global assembly cache?&lt;br /&gt;a. Using this you can place assemblies at one common place. this common place is known as global assembly cache. the advantage of this global assembly cache is that the assemblies placed in this common place can be shared by many applications. they are not restricted to a particular application. they can be shared by any application. when you place an assembly in to global assembly cache that assembly should have a strong name. Global assembly cache is placed in the subdirectory of the systemroot directory.&lt;br /&gt;&lt;br /&gt;31. What are the ways to keep assemblies in to global assemby cache?&lt;br /&gt;a. 3 ways.&lt;br /&gt;1. using windows installer&lt;br /&gt;2. using global assembly cache tool&lt;br /&gt;3. using windows explorer&lt;br /&gt;&lt;br /&gt;32. what is advantage of windows installer ?&lt;br /&gt;a. This should be used in the deployment time. this provides reference counting of an assembly.&lt;br /&gt;&lt;br /&gt;33. what is a strong name?&lt;br /&gt;a. when you want to place assembly in global assembly cache you should give strong name to that assembly. It contains assembly name, its version, public key and digital signature.This is used to uniquely identify an assembly, and to perform integrity checks on assembly. It ensures that no one can create a subsequent version of an assembly.&lt;br /&gt;&lt;br /&gt;34. what are the advantages of global assembly cache?&lt;br /&gt;a. 1. assemblies placed in GAC can be shared by multiple applications.&lt;br /&gt;2. It provides security.&lt;br /&gt;3. It provides a way to keep multiple versions of same assembly on the same machine.&lt;br /&gt;&lt;br /&gt;35. can we place the contents of an assembly into different files?&lt;br /&gt;a. Yes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-1773484370804454372?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/1773484370804454372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=1773484370804454372' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/1773484370804454372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/1773484370804454372'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/interview-questions.html' title='Interview Questions - Part 3'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-2442872397583930569</id><published>2008-12-22T08:48:00.000-08:00</published><updated>2009-02-12T15:14:48.195-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net Interview Questions'/><title type='text'>Interview Questions - Part 2</title><content type='html'>Interview Questions&lt;br /&gt;--------------------------&lt;br /&gt;16. What is Global.asasx file?&lt;br /&gt;a. This file contains application and session level events. It is an optional file. It is placed in the&lt;br /&gt;root directory of the application.&lt;br /&gt;&lt;br /&gt;17. what is the difference between inline and code behind models?&lt;br /&gt;a. In inline model server code is written along with the html code.&lt;br /&gt;in code behind model server side code is written in separate file having .aspx extension.&lt;br /&gt;&lt;br /&gt;18. How many types of validation controls are there in asp.net?&lt;br /&gt;there are 6 types of validation controls are there.&lt;br /&gt;1.RequiredFieldValidator:&lt;br /&gt;Used to ensure that there is an entry for a specified field.&lt;br /&gt;2. CompareValidator:&lt;br /&gt;Used to check users entry with a constant value or value of another control&lt;br /&gt;3. RangeValidator:&lt;br /&gt;Used to check whether users value is with in the specified range or not.&lt;br /&gt;4. RegularExpressionValidator:&lt;br /&gt;Used to check users entry against a pattern specified by regular expression.&lt;br /&gt;5. CustomValidator:&lt;br /&gt;Enables a user to specify his/her validation logic&lt;br /&gt;6. ValidationSummary:&lt;br /&gt;Used to display all the error messages at one place in a web page.&lt;br /&gt;&lt;br /&gt;19. which directive do we use to add a custom or user control to a web page?&lt;br /&gt;a. We use @Register control.&lt;br /&gt;&lt;br /&gt;20. What is the extension and namespace for user controls?&lt;br /&gt;a. User controls have .ascx extension and namespace is System.Web.UI.Usercontrol&lt;br /&gt;&lt;br /&gt;21. What are master pages?&lt;br /&gt;a. Master pages provide a uniform layout for all pages in your application. They are used to&lt;br /&gt;create same look and feel for all pages.they provide a template which can be used by any&lt;br /&gt;number of pages in an application. They have .master extension.&lt;br /&gt;&lt;br /&gt;22. Is it possible to nest master pages?&lt;br /&gt;a. Yes.&lt;br /&gt;&lt;br /&gt;23. What is a wizard control?&lt;br /&gt;a. This provides a way to create a sequence of steps which can be used by the user. This&lt;br /&gt;control is useful in suituations where you want to split the information in to steps.&lt;br /&gt;for ex. When you are registering in to any web site we can divide the information&lt;br /&gt;collection process from the user in to 3 steps, step1 for login information, step 2 for&lt;br /&gt;personal inrmation and step 3 for address information.&lt;br /&gt;&lt;br /&gt;24. what is the method used to set focus on any control?&lt;br /&gt;a. We use Focus() method.&lt;br /&gt;&lt;br /&gt;25. what is smart navigation?&lt;br /&gt;a. 1. It maintains same scroll position during postbacks.&lt;br /&gt;2. used to keep element focus during navigation&lt;br /&gt;3. used to minimise flash during navigation&lt;br /&gt;4. only the most recent web page state is retained in the browsers history folder.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-2442872397583930569?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/2442872397583930569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=2442872397583930569' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/2442872397583930569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/2442872397583930569'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/16.html' title='Interview Questions - Part 2'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-6705982736900865060</id><published>2008-12-17T12:16:00.000-08:00</published><updated>2009-02-12T15:14:01.168-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net Interview Questions'/><title type='text'>Interview Qusetions - Part 1</title><content type='html'>&lt;strong&gt;Interview Questions&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;---------------------------&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. What is a private assembly?&lt;br /&gt;a. An assembly which is used by only one application and which is placed in the installation directory of an application.&lt;br /&gt;&lt;br /&gt;2. what is MSIL?&lt;br /&gt;a. When we compile a c# program or any other program written in .net complaint languages, the source code is compiled in to MSIL. It is an instruction set in to which all .net prgrams are compiled and which is used by the CLR. It contains instruction for loading, storing, initializing, and calling methods.&lt;br /&gt;&lt;br /&gt;3. What is CTS?&lt;br /&gt;a. CTS means common type system. It defines how types are declared, used and managed in the runtime. This supports a variety of types and operations found in most of the programming languages and therefore calling one language from another does not require type convertions.&lt;br /&gt;&lt;br /&gt;4. What is CLS?&lt;br /&gt;a. CLS means common language specification. This enables interoperability in the .net platform.&lt;br /&gt;&lt;br /&gt;5. What is JIT?&lt;br /&gt;A. It is a compiler that converts MSIL to native code.&lt;br /&gt;&lt;br /&gt;6. why do we use namespaces?&lt;br /&gt;a. Namespaces are used to organise the code and to create globally unique types to avoid name collisions.&lt;br /&gt;&lt;br /&gt;7. What is web farm?&lt;br /&gt;a. Asp.net runs with in a process known as asp.net worker process. All asp.net functionality runs with in the scope of this process. A regular web server contains only a single asp.net worker process. A web farm contains multiple asp.net worker processes. Generally normal(small) web sites uses a single web server to satisfy the user requests. but a web farm(larger web sites) uses one or more seb servers to satisfy the user requests.&lt;br /&gt;&lt;br /&gt;8. What is Globalization?&lt;br /&gt;a. It is the process of design and development of applications that serve multiple cultures.&lt;br /&gt;&lt;br /&gt;9. What is Localization?&lt;br /&gt;a. It is a process of customizing an application for a given culture and locale.&lt;br /&gt;&lt;br /&gt;10. What is a Thread?&lt;br /&gt;a. A thread is a basic unit to which operating system allocates processor time. One process can have more than one thread. Each thread maintains exception handlers, scheduling priorities, and a set of structures the system uses to save the thread context until it is scheduled.&lt;br /&gt;&lt;br /&gt;11. Differences between managed code and unmanged code?&lt;br /&gt;Managed code:&lt;br /&gt;1.It is executed under CLR.&lt;br /&gt;2.It compiles to intermediate language&lt;br /&gt;3. it provides services like security, exception handling, garbage collection etc&lt;br /&gt;4. It can access both managed and unmanaged data&lt;br /&gt;unmanaged code :&lt;br /&gt;1. It is not executed under CLR.&lt;br /&gt;2. It compiles directly to machine code.&lt;br /&gt;3. It doen not provide security, exception handling, garbage collection etc&lt;br /&gt;4. It can access only unmanaged data.&lt;br /&gt;&lt;br /&gt;12. What is a bin directory?&lt;br /&gt;a. It contains precompiled assemblies. this is useful when you need to use code that is possibly written by someone else where you don't have access to the source code but you have a compiled dll instead.&lt;br /&gt;&lt;br /&gt;13. What is the use of enableviewstatemac property?&lt;br /&gt;a. This is the attribute of a @page directive. This is used to check whether the view state has been tampered or not.&lt;br /&gt;&lt;br /&gt;14. How to change a master page during rntime?&lt;br /&gt;a. This is possible in the PreInit() event by setting MasterPageFile property to .master page.&lt;br /&gt;&lt;br /&gt;15. What is serialization?&lt;br /&gt;a. It is a process of saving the state of an object by converting it to a stream of bytes. the object can then be persisted to a file, database, or even memory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-6705982736900865060?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/6705982736900865060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=6705982736900865060' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/6705982736900865060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/6705982736900865060'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/interview-qusetions.html' title='Interview Qusetions - Part 1'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-432763496967761481</id><published>2008-12-11T19:40:00.000-08:00</published><updated>2009-02-12T15:26:56.999-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='State Management'/><title type='text'>State Management in Asp.Net</title><content type='html'>&lt;strong&gt;Server side state management (Part-3)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In this type state information will be stored on the server side.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Application state: &lt;/strong&gt;It is used to store application specific information. This is stored in the server memory. Information stored in application state is common to all users and all sessions. Generally data which does not change often is stored in the application state.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Advantages:&lt;br /&gt;&lt;/em&gt;a) As it is common all sessions we can keep a single copy.&lt;br /&gt;b) Easy to implement&lt;br /&gt;&lt;em&gt;Disadvantages:&lt;br /&gt;&lt;/em&gt;a) We lose data stored in application state when the web server process Containing it is destroyed.&lt;br /&gt;b)As values stored in application state is particular to one process other&lt;br /&gt;Processes can’t use those values.&lt;br /&gt;c) As it requires server resources it may effect the performance of the server&lt;br /&gt;And the scalability of the application&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Session State:&lt;/strong&gt; It Contains Session specific information that needs to be maintained between multiple page requests and server round trips. A session starts when the user enters in to the web site and session ends when he/she leaves the web site( which is called user’s. session). So, Session state object is used to maintain that particular session values. If there are multiple users for a web site then each one will have their own session. Generally session state is used to store data which is sensitive and which changes frequently. It can configured in web.config file.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Advantages:&lt;br /&gt;&lt;/em&gt;a)Easy to implement&lt;br /&gt;b)Session state is suitable for multi computer and multi process settings.&lt;br /&gt;c) We can use session with cookies or without cookies&lt;br /&gt;&lt;em&gt;Disadvantages:&lt;br /&gt;&lt;/em&gt;a)As it is specific to a particular user session we need to maintain multiple Sessions for multiple users.&lt;br /&gt;b)As it requires server resources it may effect the server performance.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Database support: &lt;/strong&gt;This is mainly used in cases where you want to store more amount of information. Using this method for each request your application contacts the database.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Advantages:&lt;br /&gt;&lt;/em&gt;a) We can store large amount of information&lt;br /&gt;b) It provides more security&lt;br /&gt;c) Using this option we can store data for longer time&lt;br /&gt;d) It provides data consistency&lt;br /&gt;&lt;em&gt;Disadvantages:&lt;br /&gt;&lt;/em&gt;a) As this stores state information in database it effects server performance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-432763496967761481?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/432763496967761481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=432763496967761481' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/432763496967761481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/432763496967761481'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/aspnet-state-management.html' title='State Management in Asp.Net'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-5236032330201838329</id><published>2008-12-11T18:17:00.000-08:00</published><updated>2009-02-12T15:21:34.955-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='State Management'/><title type='text'>State Mnagement in Asp.Net</title><content type='html'>&lt;strong&gt;Client side statemanagement (Part-2)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1. View state:&lt;/strong&gt; It is a in built structure for maintaining the state of a page. Its purpose is to keep the state of controls during subsequent post backs by the same user. It indicates the state of an object at that particular instant of time. It is maintained using hidden fields.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Advantages:&lt;br /&gt;&lt;/em&gt;a) As it is a client side technique it does not require server resources&lt;br /&gt;b) It is a in built structure&lt;br /&gt;c) It is little secured as the values in view state are hashed, compressed and encoded&lt;br /&gt;&lt;em&gt;Disadvantages&lt;br /&gt;&lt;/em&gt;a) As view state is stored in the page itself, if we store more information in view state it affects the performance of the page&lt;br /&gt;b) As view state is stored in the page itself we can view its contents when we view the source code.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. HiddenFields:&lt;/strong&gt; This is used to store page specific information in hidden fields.&lt;br /&gt;This used to store values in html form with out displaying it on the browser.&lt;br /&gt;We can use these for the page which post backs to itself or to another page.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Advantages:&lt;br /&gt;&lt;/em&gt;a) As it is a client side technique it does not require server resources.&lt;br /&gt;b) Most Browsers support this technique&lt;br /&gt;&lt;em&gt;Disadvantages:&lt;br /&gt;&lt;/em&gt;a) As Hidden Fields is stored in the page itself, if we store more information in&lt;br /&gt;Hidden fields it affects page performance&lt;br /&gt;b) Security is less as users can view the information in hidden fields when they&lt;br /&gt;Open the source code.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Cookies:&lt;/strong&gt; A cookie is a file stored on users computer containing information Specific one site. Values stored in a cookie are sent to the same server with every page request through browser. Means they are posted back and forth on every request. Generally frequently changing information will be kept in a cookie. Default life time of a cookie on user s machine is 100000 minutes.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Advantages:&lt;br /&gt;&lt;/em&gt;a) It does not require server resources.&lt;br /&gt;b) It is very simple to implement&lt;br /&gt;c) Cookie can expire when browser session ends or it can stay permanently till we apply some expiration rules.&lt;br /&gt;&lt;em&gt;Disadvantages:&lt;br /&gt;&lt;/em&gt;a) Security is less as users can manipulate cookies on their machines.&lt;br /&gt;b) Most Browsers allows only cookie with a max size of 4096 bytes&lt;br /&gt;c) As there is security threat some users may disable their machines capability of receiving cookies thus reducing its functionality.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Query Strings:&lt;/strong&gt; Query string is the information which we see at the end of the pages Url. Generally it is used to place navigation specific information.&lt;br /&gt;We can’t keep sensitive information using query string.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Advantages:&lt;br /&gt;&lt;/em&gt;a) It Does not require server resources&lt;br /&gt;b) It is very easy to implement&lt;br /&gt;c) Most Browsers support this feature&lt;br /&gt;&lt;em&gt;Disadvantages:&lt;br /&gt;&lt;/em&gt;a) There is a security risk as it is visible in the browsers address bar.&lt;br /&gt;b) Using query strings we can’t place more information.(2083 character limit)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Control State:&lt;/strong&gt; This is used to store custom control data between server trips.&lt;br /&gt;This is used to store small amounts of information of a control between server trips.&lt;br /&gt;By default it is stored in hidden fields on a page.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Advantages:&lt;br /&gt;&lt;/em&gt;a) server resources are not required&lt;br /&gt;b) Easy to implement.&lt;br /&gt;c) We can’t turn off control state at the page level. So, it is more reliable&lt;br /&gt;&lt;em&gt;Disadvantages:&lt;br /&gt;&lt;/em&gt;a) To use this we need to write code for saving and loading of control state.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-5236032330201838329?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/5236032330201838329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=5236032330201838329' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/5236032330201838329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/5236032330201838329'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/client-side-statemanagement-1.html' title='State Mnagement in Asp.Net'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-6065384697483724972</id><published>2008-12-10T09:26:00.000-08:00</published><updated>2009-02-12T15:21:56.942-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='State Management'/><title type='text'>StateManagement in Asp.Net</title><content type='html'>State Management in ASP.NET (Part-1)&lt;br /&gt;------------------------------------------------&lt;br /&gt;&lt;br /&gt;State management is a process through which you can maintain the page information over multiple requests for the same page or different page.&lt;br /&gt;Earlier, in ASP, if you submit a form with values and come back to it later you will get the form without values. Sometimes you may submit a form with huge information in these situations if the server comes back with an error you need to fill the entire page or form once again. It’s tedious task. All this is because of lack of state management.&lt;br /&gt;But, In Asp.Net There are many ways to keep track of page information or state.&lt;br /&gt;Means if you submit a form with values and come back to it later the values will still be there. You need not to fill the page once again.&lt;br /&gt;&lt;br /&gt;There are 2 types of state management techniques&lt;br /&gt;1.Client side state management&lt;br /&gt;2.Server side state management&lt;br /&gt;&lt;br /&gt;1.Client side state management&lt;br /&gt;In this type page information is stored on the client side. There are different ways to maintain state on client side&lt;br /&gt;View state&lt;br /&gt;Hidden fields&lt;br /&gt;cookies&lt;br /&gt;query strings&lt;br /&gt;control state&lt;br /&gt;2. server side state management&lt;br /&gt;In this type page information is stored on the server side. Here also you have many techniques to maintain state.&lt;br /&gt;Application state&lt;br /&gt;Session state&lt;br /&gt;Profile properties&lt;br /&gt;Database&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-6065384697483724972?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/6065384697483724972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=6065384697483724972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/6065384697483724972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/6065384697483724972'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/statemanagement-in-aspnet.html' title='StateManagement in Asp.Net'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-3515673958512918472</id><published>2008-12-09T15:10:00.000-08:00</published><updated>2009-02-12T15:23:45.188-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net Page Life Cycle'/><title type='text'>Asp.Net Page Life Cycle</title><content type='html'>&lt;strong&gt;Asp.Net Page Life Cycle&lt;br /&gt;&lt;/strong&gt;------------------------------&lt;br /&gt;Page life cycle is the cycle through which a page performs a series of processing steps&lt;br /&gt;&lt;br /&gt;There are mainly 10 events in asp.net 2.0 page life cycle&lt;br /&gt;&lt;em&gt;1. PreInit():&lt;/em&gt; In this event we set master page and themes property dynamically&lt;br /&gt;------------&lt;br /&gt;and IsPostBack property is checked to determine whether this is a new request or postback request.&lt;br /&gt;&lt;em&gt;2.Init():&lt;/em&gt; This is used to initialize control properities&lt;br /&gt;--------&lt;br /&gt;&lt;em&gt;3.InitComplete():&lt;/em&gt;This is used to perform tasks which need initialization be complete&lt;br /&gt;-----------------&lt;br /&gt;&lt;em&gt;4.PreLoad():&lt;/em&gt; This is used to load viewstate for the page and its contents.&lt;br /&gt;-------------&lt;br /&gt;&lt;em&gt;5.Load():&lt;/em&gt; This is used to establish database connections and to set control properties&lt;br /&gt;------------&lt;br /&gt;&lt;em&gt;6.LoadComplete():&lt;/em&gt;This is used to Perform tasks which need loading be complete&lt;br /&gt;--------------------&lt;br /&gt;&lt;em&gt;7.PreRender():&lt;/em&gt;This is used to make final changes to the contents of page and its controls&lt;br /&gt;----------------&lt;br /&gt;&lt;em&gt;8.SaveStateComplete():&lt;/em&gt;Before this event view state for the page and all its controls is saved.Any&lt;br /&gt;------------------------&lt;br /&gt;changes to the page or controls in this event are ignored&lt;br /&gt;&lt;em&gt;9.Render():&lt;/em&gt;During this event page calls Render() method on all its controls that writes out the&lt;br /&gt;--------------&lt;br /&gt;controls markup that is sent to the browser.&lt;br /&gt;&lt;em&gt;10.Unload():&lt;/em&gt;This event occurs for each control and for the page. This is used to make final&lt;br /&gt;--------------&lt;br /&gt;cleanup for specific controls such as database connections&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-3515673958512918472?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/3515673958512918472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=3515673958512918472' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/3515673958512918472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/3515673958512918472'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/asp.html' title='Asp.Net Page Life Cycle'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-5398933518022513296</id><published>2008-12-08T13:34:00.000-08:00</published><updated>2009-02-12T15:22:37.318-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Directives In Asp.Net'/><title type='text'>Directives for Asp.Net Web Pages</title><content type='html'>Directives&lt;br /&gt;---------------&lt;br /&gt;Directives are used to specify the settings used by the page or usercontrol compilers to process pages or usercontrol files&lt;br /&gt;&lt;br /&gt;There are 11 types of directives&lt;br /&gt;&lt;a href="mailto:1.@Page"&gt;1.@Page&lt;/a&gt;: This is used to define page specific attributes. It is used only in .aspx files&lt;br /&gt;&lt;a href="mailto:2.@Control"&gt;2.@Control&lt;/a&gt;: This is used to define Control specific attributes. It is used only in .ascx files&lt;br /&gt;&lt;a href="mailto:3.@Master"&gt;3.@Master&lt;/a&gt;: This is used to define masterpage specific attribute. It is used only in .master files&lt;br /&gt;&lt;a href="mailto:4.@Import"&gt;4.@Import&lt;/a&gt;: This is used to import a namespace in to the current page or usercontrol&lt;br /&gt;5&lt;a href="mailto:5.@Register"&gt;mailto:5.@Register&lt;/a&gt;: This is used to render usercontrols and custom server controls in to a current page or usercontrol&lt;br /&gt;&lt;a href="mailto:6.@Assembly:"&gt;mailto:6.@Assembly:&lt;/a&gt;: This is used to link a page or usercontrol in to current page or usercontrol&lt;br /&gt;8&lt;a href="mailto:8.@Implements"&gt;mailto:8.@Implements&lt;/a&gt;: This is used to implement a specific .Net framework Interface in to current page or usercontrol&lt;br /&gt;9&lt;a href="mailto:9.@Outputcache"&gt;mailto:9.@Outputcache&lt;/a&gt;: This is used to apply cache techniques in to the current page or usercontrol&lt;br /&gt;&lt;a href="mailto:10.@MasterType"&gt;10.@MasterType&lt;/a&gt;: This defines a class or virtual path used to type the master property of a page&lt;br /&gt;&lt;a href="mailto:11.@Previouspagetype"&gt;11.@Previouspagetype&lt;/a&gt;: This is used to create a strongly typed reference to the source page from the target of a cross page posting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-5398933518022513296?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/5398933518022513296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=5398933518022513296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/5398933518022513296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/5398933518022513296'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/directives-for-aspnet-web-pages.html' title='Directives for Asp.Net Web Pages'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-4333898725303636174</id><published>2008-12-07T17:54:00.000-08:00</published><updated>2008-12-07T18:04:09.943-08:00</updated><title type='text'>Differences between Asp and Asp.net</title><content type='html'>ASP&lt;br /&gt;----------&lt;br /&gt;1.  Asp supports interpreted model&lt;br /&gt;2.  In asp you must place all directives on the first line of a page with in the same delimiting block&lt;br /&gt;3.  Asp uses only 2 scripting languages vb script and java script&lt;br /&gt;4.  Asp has no inbuilt facility for Validation of controls. Developer has to write code for both   client side and server side validation&lt;br /&gt;&lt;br /&gt;ASP.NET&lt;br /&gt;------------&lt;br /&gt;1.  Asp.net supports compiled model&lt;br /&gt;2.  In asp.net you can place directives at any place in .aspx file . But standard practice is to place them at the begining of the file&lt;br /&gt;3.  Asp.net is not constrained to 2 languages. we can use any .net complaint languages  like c# vb.net etc&lt;br /&gt;4.  Asp.net inbuilt facility for validation of controls. There are a set of validation controls which are easy to implement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-4333898725303636174?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/4333898725303636174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=4333898725303636174' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/4333898725303636174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/4333898725303636174'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/differences-between-asp-and-aspnet.html' title='Differences between Asp and Asp.net'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-3299693746370072310</id><published>2008-12-07T17:06:00.000-08:00</published><updated>2008-12-30T06:28:05.276-08:00</updated><title type='text'>Goals of Asp.Net 2.0</title><content type='html'>The Goals of ASP.NET 2.0&lt;br /&gt;---------------------------&lt;br /&gt;They are&lt;br /&gt;1. Developer productivity&lt;br /&gt;2. Administration and management&lt;br /&gt;3. Performance and scalability&lt;br /&gt;&lt;br /&gt;Developer productivity: Much of the focus of the asp.net 2.0 is on productivity. It achieved it by introducing new controls like Gridview, detailsview, masterpages, sitenavigation and etc.&lt;br /&gt;&lt;br /&gt;Administration and management: Asp.net 2.0 now includes a Microsoft Management Console(MMC) snap-in that enables web application administrators to edit configuration settings easily.&lt;br /&gt;This allows system administrators to edit the contents of the machine.config and web.config files directly from the dialog instead of having them examine the contents of an xml file.&lt;br /&gt;In addition to this dialog, web or system administrators have a web based way called web administration tool to administer their asp.net 2.0 applications.&lt;br /&gt;&lt;br /&gt;Performance and scalability: One of the most exciting performance enhancements of asp.net 2.0 is its Caching capability. It includes a feature called SQL Cache invalidation.&lt;br /&gt;Before asp.net 2.0 it was possible to cache the results from sql server and to update the cache based on a time interval- for ex. every 10 sec so on. This means that the end user might see stale data if the result set changed sometime during 10 sec period. but by using asp.net2.0 new feature sql cahe invalidation the output cache is triggred to change when the result set from sql server changes.&lt;br /&gt;In addition to this asp.net 2.0 now provides 64 bit support.This means that now you can run your asp.net applications on a 64 bit Intel or AMD processors.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-3299693746370072310?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/3299693746370072310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=3299693746370072310' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/3299693746370072310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/3299693746370072310'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/goals-of-asp.html' title='Goals of Asp.Net 2.0'/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3179608265346366143.post-1582837237363176894</id><published>2008-12-06T10:30:00.000-08:00</published><updated>2008-12-31T13:07:27.008-08:00</updated><title type='text'></title><content type='html'>Hi To All&lt;br /&gt;Well, this is my first post in my blog.&lt;br /&gt;I would like to share my experiences with all of you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3179608265346366143-1582837237363176894?l=srini-aspnet-tour.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srini-aspnet-tour.blogspot.com/feeds/1582837237363176894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3179608265346366143&amp;postID=1582837237363176894' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/1582837237363176894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3179608265346366143/posts/default/1582837237363176894'/><link rel='alternate' type='text/html' href='http://srini-aspnet-tour.blogspot.com/2008/12/hi-to-all-well-this-is-my-first-post-in.html' title=''/><author><name>Srini</name><uri>http://www.blogger.com/profile/15972379273279553909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
