You are on page 1of 36

Q1. Explain the differences between Server-side and Client-side code?

Ans. server
side code will execute at server (where the website is hosted) end, & all the
business logic will execute at server end where as client side code will execute at
client side (usually written in javascript, vbscript, jscript) at browser end.

Q2. What type of code (server or client) is found in a Code-Behind class?
Ans. Server side code.

Q3. How to make sure that value is entered in an asp:Textbox control?
Ans. Use a RequiredFieldValidator control.

Q4. Which property of a validation control is used to associate it with a
server control on that page?
Ans. ControlToValidate property.

Q5. How would you implement inheritance using VB.NET & C#?
Ans. C# Derived Class : Baseclass
VB.NEt : Derived Class Inherits Baseclass

Q6. Which method is invoked on the DataAdapter control to load the
generated dataset with data?
Ans. Fill() method.

Q7. What method is used to explicitly kill a user's session?
Ans. Session.Abandon()

Q8. What property within the asp:gridview control is changed to bind
columns manually?
Ans. Autogenerated columns is set to false

Q9. Which method is used to redirect the user to another page without
performing a round trip to the client?
Ans. Server.Transfer method.

Q10. How do we use different versions of private assemblies in same
application without re-build?
Ans.Inside the Assemblyinfo.cs or Assemblyinfo.vb file, we need to specify assembly
assembly: AssemblyVersion

Q11. Is it possible to debug java-script in .NET IDE? If yes, how?
Ans. Yes, simply write "debugger" statement at the point where the breakpoint
needs to be set within the javascript code and also enable javascript debugging in

the browser property settings.

Q12. How many ways can we maintain the state of a page?
Ans.u 1. Client Side - Query string, hidden variables, viewstate, cookies
2. Server side - application , cache, context, session, database

Q13. What is the use of a multicast delegate?
Ans. A multicast delegate may be used to call more than one method.

Q14. What is the use of a private constructor?
Ans. A private constructor may be used to prevent the creation of an instance for a

Q15. What is the use of Singleton pattern?
Ans. A Singleton pattern is used to make sure that only one instance of a class

Q16. When do we use a DOM parser and when do we use a SAX parser?
Ans. The DOM Approach is useful for small documents in which the program needs
to process a large portion of the document whereas the SAX approach is useful for
large documents in which the program only needs to process a small portion of the

Q17. Will the finally block be executed if an exception has not occurred?
Ans.Yes it will execute.

Q18. What is a Dataset?
Ans. A dataset is an in memory database kind of object that can hold database
information in a disconnected environment.

Q19. Is XML a case-sensitive markup language?
Ans. Yes.

Q20. What is an .ashx file?
Ans. It is a web handler file that produces output to be consumed by an xml
consumer client (rather than a browser).

Q21. What is encapsulation?
Ans. Encapsulation is the OOPs concept of binding the attributes and behaviors in a
class, hiding the implementation of the class and exposing the functionality.

Q22. What is Overloading?
Ans. When we add a new method with the same name in a same/derived class but
with different number/types of parameters, the concept is called overload and this

ultimately implements Polymorphism.

Q23. What is Overriding?
Ans. When we need to provide different implementation of a method in a child class
than the one provided by base class, we define the same method with same
signatures in the child class and this is called overriding.

Q24. What is a Delegate?
Ans. A delegate is a strongly typed function pointer object that encapsulates a
reference to a method, and so the function that needs to be invoked may be called
at runtime.

Q25. Is String a Reference Type or Value Type in .NET?
Ans. String is a Reference Type object.

Q26. What is a Satellite Assembly?
Ans. Satellite assemblies contain resource files corresponding to a locale (Culture +
Language) and these assemblies are used in deploying an application globally for
different languages.

Q27. What are the different types of assemblies and what is their use?
Ans. Private, Public(also called shared) and Satellite Assemblies.

Q28. Are MSIL and CIL the same thing?
Ans. Yes, CIL is the new name for MSIL.

Q29. What is the base class of all web forms?
Ans. System.Web.UI.Page

Q30. How to add a client side event to a server control?
Ans. Example...

Q31. How to register a client side script from code-behind?
Ans. Use the Page.RegisterClientScriptBlock method in the server side code to
register the script that may be built using a StringBuilder.

Q32. Can a single .NET DLL contain multiple classes?
Ans. Yes, a single .NET DLL may contain any number of classes within it.

Q33. What is DLL Hell?
Ans. DLL Hell is the name given to the problem of old unmanaged DLL's due to
which there was a possibility of version conflict among the DLLs.

Yes. though changes in the IIS in the properties for the site have to be made during deployment of each.Q34. Yes.NET 1. Which control in asp. Q40.Net 2. return and goto statements. In . partial classes. OR Page.0 application on the same computer? Ans.NET 2.Focus(). The data for which the memory management is taken care by . a class definition may be split into multiple physical files but partial classes do not make any difference to the compiler as during compile time. Q36. txtBox123. continue. anonymous methods. Generics.0? Ans. is used to display data from an xml file and then displayed using XSLT? Ans. though this is done clientside using an alert. Q42. What is a CompositeControl in . <asp:form id="form1" runat="server" defaultbutton="btnGo"/> .NET that is inherited by those web controls that contain child controls within them. What are the new features in . and this includes tasks for allocation de-allocation. How to instruct the garbage collector to collect unreferenced data? Ans. The finally block cannot have the break. We may call the garbage collector to collect unreferenced data by executing the System. and set its TransformSource property to set the xml control's xsl file for the XSLT transformation.0? Ans. How can we set the Focus on a control in ASP. CompositeControl is an abstract class in . Q43. What is managed data? Ans. Q41. Use the asp:Xml control and set its DocumentSource property for associating an xml file. Q35. Q38.0.Collect() method.NET? Ans.NET? Ans. What are Partial Classes in Asp. can we put a break statement in a finally block? Ans. Q37. Q39. the compiler groups all the partial classes and treats them as a single class.NET 2. Can we run ASP. Q44. prompt or confirm or by opening a new web page that looks like a messagebox.NET 2.SetFocus(NameOfControl). How to set the default button on a Web Form? Ans. Can we pop a MessageBox in a web application? Ans.Net runtime’s garbage collector.GC. Plenty of new controls.1 application and ASP. property visibility (separate visibility for get and set) and static classes.

Q51. The thread execution can be paused by invoking the Thread. Q54.2 Q50.Interupt() method. just like a scenario where a Notepad. In order to refer to the current thread in .Can we force the garbage collector to run? Ans. the garbage collector is forced to run in case required to do so.NET operator do? Ans. Q46. The AddressOf operator is used in VB. What is a Thread? Ans. . A thread is an activity started by a process and its the basic unit to which an operating system allocates processor resources. Q52.NET.NET? Ans. a Calculator and the Control Panel are open at the same time.Collect().NET? Ans. How to refer to the current thread of a method in .Sleep(IntegerValue) method where IntegerValue is an integer that determines the milliseconds time frame for which the thread in context has to sleep. Call the Thread. Boxing is the process where any value type can be implicitly converted to a reference type object while Unboxing is the opposite of boxing process where the reference type is converted to a value type. How to pause the execution of a thread in . Yes. When an application performs different tasks at the same time. Q48. What is Boxing and Unboxing? Ans. the Thread. Q49. the application is said to exhibit multithreading as several threads of a process are running.NET to create a delegate object to a method in order to point to it. Q47. CAS is the feature of the . What is Multi-threading? Ans.NET? Ans. Q53.GC. using the System.NET security model that determines whether an application or a piece of code is permitted to run and decide the resources it can use while running. How can we force a thread to sleep for an infinite period? Ans. What is Multi-tasking? Ans.Q45. What is Code Access security? What is CAS in .CurrentThread method can be used. It is a feature of operating systems through which multiple programs may run on the operating system at the same time. What does AddressOf in VB. It is a public static property.

NET is a class that can have a reference to a method. though they are public by default. Note that sleep method immediately forces the thread to sleep whereas the suspend method waits for the thread to be in a persistable position before pausing its activity.exe process but the session information is lost when IIS reboots).Resume method.NET Threading? Ans. What is Ajax? Ans.NET? Ans. Q63. What is Suspend and Resume in . Q59. Yes Q62. It is an object in Javascript that allows the browser to communicate to a web server asynchronously without making a postback. Q61.Net threading? Ans.Suspend method and may be started again using the Thread. InProc (the session state is stored in the memory space of the Aspnet_wp.NET? Ans. Asyncronous Javascript and XML . Event raising from between threads. What are the different modes of storing an ASP. Is it possible to specify an access specifier to an event in .NET. What is a delegate in . Interlocked classes. What is the return type of an event in . Q56. A delegate in . Q58.NET session? Ans. How can we prevent a deadlock in . .NET that automatically persists control setting values across the multiple requests for the same page and it is internally maintained as a hidden field on the web page though its hashed for security reasons. StateServer (the Session state is serialized and stored in a separate process call Viewstate is an object in . Q57. Just like a song may be paused and played using a music player. There is No return type of an event in . Yes.Q55. and this class has a signature that can refer only those methods that have a signature which complies with the class.Ajax is a combination of client side technologies that sets up asynchronous communication between the user interface and the web server so that partial page rendering occur instead of complete page postbacks. using the ThreadState property. a thread may be paused using Thread.NET? Ans. Q60. What is XmlHttpRequest in Ajax? Ans. Is a delegate a type-safe functions pointer? Ans. Wait handles. Using methods like Monitoring.

Is it possible to create a shared event in .NET 2.NET? Ans. Yes.ToString().NET? Ans. How to create a new unique ID for a control? Ans. but shared events may only be raised by shared methods. Items in an arraylist may be accessed using an index.NET and sealed in C#. and can be used to store key value pairs. What is an ArrayList in . Use the keyword NotInheritable in VB.Q64. What is the value of the first item in an Enum? 0 or 1? Ans.NET and sealed in C#.NET? Ans. Q70.NET? Ans. the "operator" keyword is used. 0 Q73. Q74. we cant use any other modifier other than the public modifier for the member functions of an Interface. Use the keyword NotOverridable in VB. and moreover.NET? Ans. Q67.NewGuid(). it is supported in the . Q72.NET? Ans.0 version. The key may be used as the index to access the values for that index.NET Garbage collector performs all the clean up activity of the managed objects. . and so the finalize method is usually used to free up the unmanaged .NET? Ans. What is the access modifier of a member function of in an Interface created in . it may hold items of different types. It is always public. What is a HashTable in . Q65.ID = "ControlName" + Guid. such that the size of the arraylist can be increased and decreased dynamically. Can we achieve operator overloading in VB.NET? Ans. The virtual keyword signifies that the method and property may be overridden. Q71B. A Hashtable is an object that implements the IDictionary interface. Arraylist object is used to store a list of values in the form of a list. //Make use of the Guid class Q71A.NET? Ans. What is the purpose of the MustInherit keyword in VB. Q66. Q68. How to prevent overriding of a class in . Yes.NET is used to create an abstract class. Q69. ControlName. What is the use of Finalize method in . What does the virtual keyword in C# mean? Ans. How to prevent inheritance of a class in . MustInherit keyword in VB.

NET? Ans. Q83. Q79.NET? Ans. COM objects etc from the memory. Database connection objects.NET page life cycle assures that all controls are completely loaded. and it must be protected for the set method as well. Which event of the ASP. Use the AcceptChanges method which commits all the changes made to the dataset since last time Acceptchanges was performed. Even though the controls are also accessible in Page_Init event but here. This is NOT possible because once the correct catch block is executed then the code flow goes to the finally block. Its performance is better than the finalize() method.String and System. Windows API objects. Q78. Is there any difference between System. What technique is used to figure out that the page request is a postback? Ans. Q76. Q77. Q82. System.NET belongs to IDisposable interface and it is best used to release unmanaged objects like File objects. How do you save all the data in a dataset in .SuppressFinalize() method.StringBuilder can have a mutable string in which plenty of processes may be performed.NET? Ans.NET. What is the use of the dispose() method in . IsPostBack property is of the type Boolean. COM objects etc. No we can not have different modifiers of a common property. The Page_load event of the ASP. The IsPostBack property of the page object may be used to check whether the page request is a postback or not.NET? Ans.NET page life cycle completely loads all the controls on the web page? Ans. Q80. The Dispose method in . Is there a way to suppress the finalize process inside the garbage collector forcibly in . Database connection objects. which means that if the access modifier of a property's get method is protected.objects like File objects. In .String is immutable by nature whereas System. the viewstate is incomplete. is it possible for two catch blocks to be executed in one go? Ans.StringBuilder classes? Ans. How is ViewState information persisted across postbacks in an . Is it possible to have have different access modifiers on the get and set methods of a property in . Q81. Q75. Windows API objects. Use the GC.

. Yes. Using HTML Hidden Fields.ASP. How to we add customized columns in a Gridview in ASP. simply EnableClientScript = false. Repeater.NET? Ans. Q85.config file is used to make settings to all ASP. Datalist. Datagrid or Datalist? Ans.NET? Ans. What is the ValidationSummary control in ASP. Web.Validate = false.NET used for? Ans.config file is used to make the settings to a web application.NET webpage? Ans. Q92. Make use of the TemplateField column. The ValidationSummary control in ASP. Q86. Set Page. A session object can persist information between HTTP requests for a particular user. Q89. whereas Machine. Q88. <%@ Page Trace="true" %> Q94. What is the difference between a session object and an application object? Ans.abandon() method. whereas an application object can be used globally for all the users.NET creates a hidden field with an ID="__VIEWSTATE" and the value of the page's viewstate is encoded (hashed) for security. How do we enable tracing in .NET? Ans. Which control has a faster performance.config and Machine.Config in . Which control has a faster performance. Q93. Is it possible to disable client side script in validators? Ans. Repeater or Datalist? Ans.NET displays summary of all the current validation errors. Q84. How to kill a user session in ASP.NET applications on a server(the server machine).NET applications? Ans. Q91. Q87. Is it possible to stop the clientside validation of an entire page? Ans. What is AutoPostBack feature in ASP. Q90. ASP. What is the difference between Web.NET? Ans. Use the Session. In case it is required for a server side control to postback when any of its event is triggered. then the AutoPostBack property of this control is set to true.

A DataReader provides a forward-only and read-only access to data. Q1 . Yes.NET? Ans.config? Ans.config is used for web based asp. Q2 . A Design pattern is a repeatitive solution to a repeatitive problem in the design of a software architecture.config is used for windows based applications. Can connection strings be stored in web. it is possible. in fact this is the best place to store the connection string information.config? Ans.config and app. .Select distinct * from t_employee.Write a query to eliminate duplicate records in the results of a table A2 .Write a query to find the total number of rows in a table A1 . What is difference between dataset and datareader in ADO. Q100. Whats the difference between web. Q99. while the DataSet object can carry more than one table and at the same time hold the relationships between the tables. Is it possible to perform forms authentication with cookies disabled on a browser? Ans. Yes. <ItemTemplate> <asp:CheckBox id="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="Check_Clicked"></asp:CheckBox> </ItemTemplate> Q97.NET? Ans. applications whereas app. What are the steps to use a checkbox in a gridview? Ans.Q95. Q98. What are design patterns in . Also note that a DataReader is used in a connected architecture whereas a Dataset is used in a disconnected architecture. Q96.Select count(*) from t_employee.

Select max(salary) from t_salary.UNION is an SQL keyword used to merge the results of two or more tables using a Select statement.Write a query to concatenate two fields. the indexed column of the table needs to be set as a parameter in the where clause select * from t_employee where id='43'.Insert into t_employee values ('empid35'.One time. whereas the IN clause fetches data from a list of specified values. UNION ALL does the same. based on a record.Write a query to insert a record into a table A3 . Q9 -What is the difference between UNION and UNION ALL in SQL? A9 . Q7 .Write a query to delete a record from a table A4 . that are used inside a WHERE clause? A11 . with removed duplicate values.Q3 .Write a query to fetch the highest record in a table. Q10 . Q5 .What is the difference between IN and BETWEEN. -. Q6 .1.The BETWEEN clause is used to fetch a range of values.'Barack'. how many times should a Union be used to remove duplicate rows? A10 .For this.Write a query to display a row using index A5 .'Obama').Note here that the substr function has been used.Select substr(designation. Q11 .Write a query to fetch the first 3 characters of the field designation from the table t_employee A7 .delete from t_employee where id='empid35'. say salary field in the t_salary table A6 . Q4 .3) from t_employee. .If there are 4 SQL Select statements joined using Union and Union All. Q8 . say Designation and Department belonging to a table t_employee Select Designation + ‘ ‘ + Department from t_employee. however it persists duplicate values. containing the same fields.

A11.Whats the capacity of the image data type in MS SQL? A17 .Whats the capacity of varbinary data type in MS SQL? A18 .Explain the use of the ‘LIKE’ keyword used in the WHERE clause? Explain wildcard characters in SQL. where for instance. the HAVING selects groups which match the criteria specified.Explain the use of the by GROUP BY and the HAVING clause. Gatsburg. This query fetches all records contains gats in the e middle of the string.647) bytes.000 bytes. etc.483. Q14 .Q12 . Q18 . the department column is nullable. to match a search criteria: Select empid. lastname from t_employee where department is null.The GROUP BY partitions the selected rows on the distinct values of the column on which the group by has been done.1 (2. Select empid. firstname. lastname from t_employee where lastname like ‘%gats%’ This might search all employees with last name containing the character sequence 'gats' like Gates. CLOB ( Binary Large Objects. Q16 -What are the large objects supported by oracle and db2? What are the large objects supported in MS SQL? A16 . Q15 . firstname. The symbol ‘%’ ( for a string of any character ) and ‘_’ (for any single character ) are the two wild card characters used in SQL.When a partial search is required in a scencario. Q17 .the data types are image and varbinary. Sogatsky. Gatsby. Character Large Objects) are used. Write a query to fetch employees which are not assigned a department yet. then you may use the following query.LIKE is used for partial string matches. Q13 . % is used to represent remaining all characters in the name. In MS SQL . .In Oracle and DB2 BLOB . In tandem.Variable-length binary data with a maximum length of 8.In a table t_employee.147. A12 .Variable-length binary data with a maximum length of 2^31 . A14 .What is the need to use a LIKE statement? A13 . you need to find all employees with the last name having the sequence of characters "gat".

All steps must be committed or rolled back. In SQL.Both Primary key and Unique key enforce the uniqueness of a column on which they are defined. Consistency. a Primary key does not allow nulls. Q20 . DDL stands for Data Definition Language. Query: Select A.Q19 .A transaction is a logical unit of joins. Q22 . whereas unique key allow nulls.A join created by joining two or more instances of a same table.aspx Q21 .Atomicity.What are the different types of joins in SQL? INNER JOIN OUTER JOIN LEFT OUTER JOIN RIGHT OUTER JOIN FULL OUTER JOIN INNER JOIN Read here for more http://www. .supervisor_id = B. Alter and Drop commands. However. Isolation and Durability. t_employee B where A.What’s the difference between a primary key and a unique key? A19 .What is a Self join? A21 .Transaction .dotnetuncle. and further the entities inside these tables like columns. these are the unique entities of a transaction.firstname from t_employee A. What are DDL statements in SQL? Explain the Create. B. ACID .firstname . It is the part of SQL programming language that deals with the construction and alteration of database structures like tables.What is a transaction and ACID? A22 . It may be used to set the properties of columns as well. views.employee_id.

If we do not use the abstract keyword. we make use of the abstract keyword. Its then in the hands of the descendant class to provide the details of the method. but this is not an abstract method. To use the definitions defined in the abstract class. . and can be overriden in the child class as well. Syntax below: abstract public class Vehicle { } Above. and then instances of the Child class may be easily created. Further. We may use the fields. properties and member functions defined within this abstract class to create child classes like Car. Bike etc. the child class inherits from the abstract class. for which we use the abstract keyword. we may define abstract methods within an abstract class (analogous to C+ + pure virtual functions) when we wish to define a method that does not have any default implementation. 1. an abstract class named Vehicle has been defined. To prevent directly creating an instance of the class Vehicle. only definition } } Example: Abstract Class with Virtual method namespace Automobiles { public abstract class Vehicle { public virtual void Speed() //Can have an implementation. For creating an abstract class. that does not have any implementation. we create an Abstract class... we may provide an implementation of the method that can be used by the child class. Read example below Example: Abstract Class with Abstract method namespace Automobiles { public abstract class Vehicle { public abstract void Speed() //No Implementation here. Such a class cannot be instantiated. We define an abstract method using the abstract keyword. Remember. There may be any number of abstract methods in an abstract class. that may be overriden in child class { . using the override keyword. Questions on Differences between Q. and use the virtual keyword instead. What is the difference between abstract class and interface? If a class is to serve the purpose of providing common fields and members to all subclasses. abstract class can have an abstract method. Truck. we make use of the abstract keyword. that inherit the features defined within the abstract class. OR the abstract class may have a virtual method. that can have an implementation.

The members defined in an interface contain only definition. but members of an interface are public by default. Internal. An interface expresses through the members it defines. For these kind of requirements. See code below: Public interface IVehicle //As a convention. it can be accessed from anywhere. Friend. say ICoupe. it may inherit from an Aabstract class named Vehicle. The members of an interface are all public by default. a coupe. If a member of a class is . The availability (scope) of the member objects of a class may be controlled using access specifiers. then the class Car needs to implement a member field from an interface. Default The main purpose of using access specifiers is to provide security to the applications. 3) Abstract class methods may OR may not have an implementation. Say a class named Car needs to inherit some basic features of a vehicle. no implementation. an interface is prefixed by letter I { Boolean HasFourWheels() } Time to discuss the Difference between Abstract Class and Interface 1) A class may inherit only one abstract class.. 1. Private. A car may be of any kind. that we make.. any other access specifier cannot be used. no implementation. a sedan. say a car needs to have only two seats (means it is a coupe). the behaviors that a class needs to support. we override whatever implementation is there in the abstract class { . //Child class implementation of the method Speed() } } } An Interface is a collection of semantically related abstract members. 2) Members of an abstract class may have any access modifier. Protected. while methods in an Interface only have a definition. but may implement multiple number of Interfaces. PUBLIC As the name specifies. it may be a vintage car. An interface is defined using the keyword interface. and cant have any other access modifier. } } Public class Car : Vehicle { Public override void Speed() //Here. or a racing car. Explain the access specifiers Public.

6. and ofcourse. FRIEND/INTERNAL Friend & Internal mean the same. Friend is used in VB. 2.defined as public then it can be accessed anywhere in the class as well as outside the class. Default properties do not promote good code readability. A class is a blueprint that describes how an instance of it (object) will behave. an object is the backbone of everything that we see. PROTECTED FRIEND/PROTECTED INTERNAL The Protected Friend can be accessed by Members of the Assembly or the inheriting class. Friends can be accessed by all classes within an assembly but not from outside the assembly. methods. so use this option sparingly. PRIVATE As the name suggests.NET. Whats the difference between a class and an object? In any object Oriented language. DEFAULT A Default property is a single property of a class that can be set as the default. Internal is used in C#. We make use of the keyword class. 3. properties. To create a class. it can't be accessed outside the class. This means that objects can access and modify public fields. 4.vb. PROTECTED Protected variables can be used within the class as well as the classes that inherites this class.cs or *. } } . public Laptop() {} public Laptop(string name) { sbrand = name. within the class itself. 5. we define it in a "Code File". Default properties cannot be initialized as Shared/Static or Private and all must be accepted at least on argument or parameter. Example Lets create a class named Laptop public class Laptop { private string sbrand. This allows developers that use your class to work more easily with your default property because they do not need to make a direct reference to the property. Its the private property of the class and can be accessed only by the members of the class. with an extension *.

give a reference to the exact class. while non-static members are instance members (means they are owned by the instances). obj. This reference is not to the actual object itself. Console obj = new Console(). Static Member .... properties. We may allocate any number of objects using the new keyword. To make this work.Writeline("Vishal likes static members"). Console.From our code that references this class.. we write. no need to create their instances.A class member declared with the keyword static is a static member. when it is no longer reachable by any part of the code.. What is the difference between Shared and Static? They both mean the same. Note that static members are actually class members. //This line does'nt print //This does'nt work. To work with members of static classes. we may create static/shared events. //Passing a variable to the class constructor Once the class object is created. Note Static member functions cannot access non-static members directly. Static is used in C#.NET runtime. Laptop lp = new Laptop("Lenovo"). rather than from the instance. Shared is used in VB.NET.NET. A static member is owned by the class. When we allocate an object to a heap. The garbage collector takes care of the object by removing it from the heap. write. Note Indexers in C# cannot be declared static. Consider the following example //Consider writing the following line of code. because WriteLine is a static method defined in the class Console //The Console class is a static class To use static members.. the member in context must be directly invoked from the class. When the static keyword is used to declare a class. What is the difference between value type and reference type? Can a value type contain NULL values? . The new keyword returns a reference to an object on the heap. The variable being refered is stored on a stack for usage in the application. its managed by the . fields and functions.Writeline("Vishal likes static members"). as an instance in this case won't work. the object may be used to invoke the member functions defined within the class. not by its instances (objects of the class). Both in C# & VB.

By saying heap. that may run on its own. Enumerations and Structures are examples of Value Types. A value type may not contain NULL values. Classes. When we use the "String" object to concatenate two strings. Where as a DLL is a Dynamic Link Library. and runs as an independant process. while all reference based types are allocated on the heap. the first string is combined to the other string by creating a new copy in the memory as a string object. Yet. all value based types are allocated on the stack. Data types like integers. that is referenced by a pointer to it. This is possible in Reference types. we mean things are kept in a mashed order. it is copied. or another DLL at runtime. as the application references it. A DLL has an exposed interface. The most common operation with a string is concatenation. When a value type is assigned to another value type. All value types are implicitly derived from System.Object. A reference type contains a reference to the value. Hence we say "Strings are immutable". It is not possible to derive new types from Value Types. we mean things are kept one on top of the other. Strings. Its independant. the base class for all objects which is a reference type itself. This activity has to be performed very efficiently. Arrays are examples of Reference Types. What does this mean? A value type contains the actual value. Value Types like Structures can implement interfaces.In simple words. A DLL runs in tandem with the application space in memory.NET. By saying stack. Whereas an EXE is independant. character data. floating point numbers. An EXE is an executable file.ValueType. What is the difference between String and StringBuilder? Both String and StringBuilder are classes used to handle strings. Boolean values. This process is a little long. . through which members of the assembly may be accessed by those objects that require it. We keep track of each value by its address. and then the old string is deleted. a reference is assigned to the value. Reference types may contain NULL values. that binds to an exe. When a reference type is assigned to another reference type. an assembly may become a DLL or an EXE. there is a major underlying difference between the two. However. We keep track of each value at the top. What is the difference between a DLL and an EXE? In . This class actually overrides the implementation in System.

whereas Remoting has support for both stateless and with-state environment. Using Remoting. Binary objects & XML Objects may be serialized.NET. the Append method is used. the web service may or may not be built using .When we make use of the "StringBuilder" object. What is the difference between Web Services and Remoting? Both Remoting and Web Services are ways of communication between applications. or for any query where only one specific field in one column is required. * In . objects like SOAP objects. But while implementing Remoting in . The application that consumes the web service.In remoting. an insertion is done on the existing string.Communication between applications using web services is platform independent and programming independent. the applications involved in the communication process may be located on the same computer. which is achieved using Singleton and Singlecall activation * ASP.Returns only one value after execution of the query. then methods like plumbing have to be used to ensure the application reliability. simply accesses it.NET. Here are some of the major differences: * ASP. * Web services may be considered very reliable. different computers in a same or different network. only a limited number of types may be serialized (XML). as the copy is done to the same location. In remoting. What is the difference between ExecuteScalar and ExecuteNonQuery? What is ExecuteReader? ExecuteScalar . They are easy to deploy. In remoting. Remoting is little complex. A proxy of an application object is created on the other application. due to the fact that they are hosted on IIS. Usage of StringBuilder is more efficient in case large amounts of string manipulations have to be performed. if IIS is'nt used.NET.NET. In comparison. Remoting objects may be accessed over any protocol like TCP. both applications know about each other. Operation on StringBuilder object is faster than String operations. * Using web services. HTTP * Web Service are Stateless. This would be excellent for receiving a count of records (Select Count(*)) in an sql statement. when we create an application that consumes a web service. This is very light-weight and is perfect when all your query asks for is one item. . both the applications must be built in .NET Web Services may be accessed using HTTP only. This means. Remoting . Web Services . It returns the first field in the first row. SMTP.NET provides good support to create Web Services. without needing to know how this web service has actually been implemented & created.

Add(objReader.ExecuteNonQuery .ExecuteReader(CommandBehavior. //The SQL Insert Statement gets executed ExecuteReader . //note that con is the connection object con.This method returns no data at all.'2')". This can be used before using the Read method to check whether any data has been retrieved.GetString(0) & vbTab & objReader.Open().Close() (NOTE: XmlReader object is used for Forward only Read only access of XML). typically as a result of a SQL Select statement. whereas DataSet works in a disconnected environment. It uses our SQL statement to read through the table from the first to the last record. It is used majorly with Inserts and Updates of tables. read only access to data from a source. What is the difference between a DataReader and Dataset in ADO.This method returns a DataReader which is filled with the data that is retrieved using the command object. Example Dim objCmd as New SqlCommand("Select * from t_Employees". Example: SqlCommand cmd = new SqlCommand("Insert Into t_SomeTable Values('1'.GetInt16(1)) Loop End If objReader. The SQLDataReader class can read rows from tables in a SQL Server data source.Read() ListBox1. This is known as a forward-only retrieval of records. A DataReader object represents a forward only. It is returned by the ExecuteReader method of the SQLCommand class. It implements IDataReader & IDataRecord interfaces.Open() Dim objReader as SqlDataReader objReader = objCom. The DataReader class' HasRows property can be called to determine whether the DataReader retrieved any rows from the source. A DataSet represents an in-memory cache of data consisting of any number of inter-related DataTable objects.NET? A DataReader works in a connected environment. objCon) objCon. A DataTable object represents a tabular block of in- . It is used for execution of DML commands.CloseConnection) If objReader.con).ExecuteNonQuery().HasRows = True then Do While objReader.Items. For example. cmd.

DataMember = "YourTableName" Gridview1."YourTableName") Suppose you want to bind the data in this dataset to a gridview Gridview1. applications were all designed to run on a single thread of execution. password=. When a thread begins to execute.SelectCommand. A process can have multiple threads in addition to the primary thread.Connection = objCon 'The Data Adapter manages on its own.Clone in .database=NameOfYourDb.NET? The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. data. and a process always has at least one thread of execution. Further.CopyTo and System. Threads executing the same block of code maintain separate stacks.) Dim da as New SqlDataAdapter Dim ds as DataSet = New DataSet da. we can use a DataView object. but its data is stored in the memory.memory data. so each application has at least one process.Databind() What is the difference between System .Fill(ds. What is the difference between a Thread and Process? A process is a collection of virtual memory space. The CopyTo() method copies the elements into another existing array. it continues until it is killed or until it is interrupted by a thread with higher priority (by a user action or the kernel’s thread scheduler). known as the primary thread.DataSource = ds Gridview1. Both perform a shallow copy. To query the data in a DataSet. Prior to the introduction of multiple threads of execution. Each thread in a process shares that process’s global variables and resources.Array. opening & closing of connection object da. . or multiple threads can execute the same section of code. Example Dim objCon as SqlConnection = New SqlConnection("server=(local).Array. and system resources.SelectCommand.CommandText = "Select * from t_SomeTable" da. A processor executes threads.user id=sa. Each thread can run separate sections of code. A Dataset is like a mini-database engine. code. A thread is code that is to be serially executed within a process. a DataRow represents a single row of a DataTable object. not processes.

Diagnostics. Tracing is the ability of an application to generate information about its own execution.0 code to help debug pages. as per the application requirement. If we set the Tracing attribute of the Page Directive to True. and System. This is done through the application level. NOTE The only difference between Trace. Typically this means that you should use System. While using application level tracing.WriteLine for tracing that you want to work only in debug builds.the difference is that tracing from the Debug class only works in builds that have the DEBUG symbol defined.What is the difference between Trace and Debug? Trace and Debug . then Tracing is enabled. If the trace is false.Write is that the former has output in red color. Here we can set <trace enabled=false .axd file of the project. The output is appended in the web form output.Debug.Trace and System. there is another way to enable tracing.Write. .Warn & Trace.Warn & Trace. The idea is that subsequent analysis of this information may help us understand why a part of the application is not behaving as it should and allow identification of the source of the error.Debug classes.There are two main classes that deal with tracing .config. Tracing is actually the process of collecting information about the program's execution./> Note that the Page Directive Trace attribute has precedence over th application level trace attribute of web. whereas tracing from the Trace class only works in builds that have the TRACE symbol defined. Debugging is the process of finding & fixing errors in our program. Authentication is the mechanism whereby systems may securely identify their users.writes we used to put in our classic ASP3. Tracing can be thought of as a better alternative to the response.Trace.Debug and Trace..TraceContext class via the System.config file and set the trace attribute to true. we can view the trace output in the trace..WriteLine for tracing that you want to work in debug and release builds. We shall look at two different ways of implementing tracing in .Diagnostics. We can use the web. Authentication systems depend on some unique bit of information known only to the individual being authenticated and the authentication system.Diagnostics.NET via the System.Web.Diagnostics. Messeges can be displayed in the Trace output using Trace. What is the difference between Authorization and Authentication? Both Authentication and Authorization are concepts of providing permission to users to maintain different levels of security. They both work in a similar way .

Works only on IE 5 or above 4) Integrated Windows Authentication . It is the compiled format of a class. Authorization in . Credentials are entered on web forms.There are two types: FileAuthorization .config file.IIS allows any user 2) Basic Authentication . When a user logs on to an application/system. the credentials are matched with the Windows domain through IIS.Authorization is the mechanism by which a system determines what level of access a particular authenticated user should have to secured resources controlled by the system. The authentication may be set using the web.this depends on the NTFS system for granting permission UrlAuthorization . . and then Authorized. 3) Digest Authentication . Windows Authentication provider is the default authentication provider for ASP. ASP. and are matched with the database table that contains the user information. but the credentials are encrypted.0) The 4th way is "None" (means no authentication) The Authentication Provider performs the task of verifying the credentials of the user ans decides whether a user is authenticated or not.NET 2.NET applications . There are 4 types of Windows Authentication methods: 1) Anonymous Authentication .NET.This authentication relies on code written by a developer.Same as Basic Authentication. where credentials are matched against a database.A windows username and password has to be sent across the network (in plain text format. When a user using this authentication logs in to an application. that contains Metadata.Relies on Kerberos technology. Manisfest & Intermediate Language code. hence not very secure).Authorization rules may be explicitly specified in web.config for different web URLs. the user is first Authenticated.NET . with strong credential encryption Forms Authentication .NET has 3 ways to Authenticate a user: 1) Forms Authentication 2) Windows Authentication 3) Passport Authentication (This is obsolete in . What is the difference between a Public Assembly and a Private Assembly? An assembly is the basic building block in .

NET command interpreter. it must have a strong name.Reflection. It is stored in the application's directory or the applications sub-directory. just like we have done above.snk This will create a strong key and save it to the location C:\samplekey. In order to convert a private assembly to a shared assembly. To make an assembly a shared assembly.AssemblyKeyFileAttribute.A shared assembly has version constraint.. to create a strongly named assembly. A Strong Name assembly is an assembly that has its own identity.. GAC is a repository of shared assemblies maintained by the .. we would make use of System. The shared assemblies may be used by many applications.e. it has to be strongly named. This belongs to the namespace System. This is used to created a cryptographic key pair. There is no version constraint in a private assembly. and type the following.snk")> We may write this in our code as well.AssemblyKeyNameAttribute.Reflection.. The key pair that is generated by the Strong Name tool can be kept in a file or we can store it our your local machine's Crytographic Service Provider (CSP).exe tool..An assembly may be either Public or Private. Go to the assemblyinfo.NET runtime. sn -k C:\samplekey.snk 2) If the key is stored in a file.This type of assembly is used by a single application. In order to share an assembly with many applications. Make the following changes in this file. A public assembly means the same as Shared Assembly.vb file of your project. we use the attribute AssemblyKeyFileAttribute. <assembly: assemblykeyfileattribute("C:\samplekey. like this. 1) Create a strong key using the sn.. through its version and uniqueness. It is located at C:\Windows\Assembly OR C:\Winnt\Assembly. It is stored in the Global Assembly Cache (GAC). For this. i. Private Assembly ..snk")> Namespace StrongName Public class Sample End Class End Namespace . Imports System. If the key was in the CSP. Open this file.. follow the steps below. goto the .Reflection <assembly: assemblykeyfileattribute("C:\samplekey. Shared Assembly or Public Assembly .

The DataAdapter provides the ability to completely customize how the central data store is updated with the changes to a DataSet. For example.exe Type the following.. The ADO.dll. Visual Studio.NET Framework by seeing the Global Assembly Cache (Go to C:\Windows\Assembly OR C:\Winnt\Assembly).NET will use. The DataSet is a disconnected cache with tracking and control binding functionality. thereby allowing a focused approach to developing code. .NET? The old ADO (ActiveX Data Object) has evolved to ADO. targets the same set of namespaces & types provided by the . controls actually comes from the class library. optimistic locking.dll. Your assembly is now strongly named. It provided fast lightweight "firehose" cursor and also supported a disconnected client-side cursor that supported tracking. When a . Classes are Reference-Types. the data that they contain is stored as a stack on the memory.Drawing namespace consists of classes. Installing the Shared assembly in GAC. namespaces may be nested (means a namespace within a namespace) to arrange classes in a hierarchical fashion..NET application. Note that a single assembly like mscorlib. all of this functionality was difficult to customize.NET command interpreter. ADO. that works on the .NET object is a lightweight object. Whats the difference betweeen Structure.dll may contain any number of namespaces.NET framework. We may view the class libraries provided by the .NET is mscorlib. use. methods that are grouped together to achieve similar tasks.NET Framework (the other being the CLR). the System. gacutil /u sampleclass. gacutil /i sampleclass.NET Framework. In fact. The main class library in . The ADO Recordset was a huge object in ADO. This library contains a large number of core types that encapsulate a wide variety of common tasks.NET in the . The class library consists of lots of prewritten code that all the applications created in . there is automatic access to this library. means they are stored as a heap on the memory.3) Build your project. What is the difference between a Class Library and a Namespace? Class Library is another major entity of the . Also note that any language.NET environment.dll To uninstall it. Namespace is a grouping of related types contained in an assembly.. This library gives the program access to runtime environment. This means. and automatic batch updates of a central database. However. The code for all the elements like forms. use the tool gacutil. Go to ...NET DataReader is equivalent to the "firehose" cursor. What is the difference between ADO and ADO. Class and Enumeration ? Structures and Enumerations are Value-Types.NET breaks the functionality of the ADO object to multiple classes.. The ADO. It provided the ability to support multiple types of cursors.NET provides a GUI tool for viewing all shared assemblies in the GAC.

} struct { int x = 5.z.ValueType. yellow}. blue. //Syntax Error } A class can inherit from one class (Multiple inheritance not possible). whereas a class can. } and we create a structure type MyStruct st = new MyStruct(). Every enumeration has an underlying type. The structure's constructor should always have a parameter. So if we define the following structure struct MyStruct { public int y. We may even make a constructor of a structure. Enum is the keyword used to define an enumeration. So when the runtime encounters a type derived from System. An enumeration is a distinct type consisting of a set of named constants called the enumerator list.ValueType is to override the virtual methods defined by System.ValueType. Note: char cant be the underlying data type for enum. A Structure cannot inherit from a structure. The default type is "int". The purpose of System. An explicit casting is required to convert an enum value to its underlying type . green is 1. //No error . Here. A struct cannot have an instance field. First value in enum has value 0. enum colors {red. each consequent item is increased by 1. remember. class A { int x = 5. In case of a class. red is 0. When we allocate a structure type. green.Structures are implicitly derived from a class called System. blue is 2 and so on. no-argument constructors are possible. but. A No-argument constructor for a structure is not possible.Object. Class is defined using the class keyword. we may also use the new keyword. then stack allocation is achieved...

There might be a scene where the programmer may only catch the exception through good code but may not prevent it. a declared file object may not be disposed. and programmers are humAns. Whats the difference between MSIL and CIL? MSIL is the name given to the intermediate language in . well thats a bug.NET Framework Beta. Difference between Bugs. stylus input. CIL is the name submitted by Microsoft to the European Computer Manufacturer's Association(ECMA) as a standard.An error may be invoked by an input made by the end user. but surely may be handled by good code. the intermediate language is called CIL. MSIL stands for Microsoft Intermediate Language. or code that handles the keyboard. mouse.exe and csc. Applications may crash or stop running because of different reasons. Its actually a low level human readable language implementation of CLI. For instance. Now say. MSIL is the old name. 1. its called a bug. Normally. There is not much difference between the two. a file being parsed by the code has been deleted by some one from the location being searched. during development of enterprise applications. These errors are usually caused at runtime.An exception may be a System Exception or an Application Exception. Now this hiccup may be categorized in three ways: 1) Bugs . then a "File Not Found" exception may crop up.yellow. Compilers like vbc. The crash may happen during the application development OR during production when the application is already x = (int)colors. These errors if not handled efficiently by the developer. A developer may be well experienced but still may write bad code by mistake. Such exceptions are usually handled by well written code by using Exception Handlers.exe compile the code into intermediate language.0 and 1. From version 2.When the cause of the error is because of a mistake done by a developer. CIL stands for Common Intermediate Language.0 onwards. But there may be times when even the Testing team might miss out on catching a bug. These types of errors may be handled using controls like RegularExpressionValidator. We can say.1. may cause . and may later cause a memory leak. Exceptions and End User Errors ? Humans are bound to make errors. For example. bugs are caught by Testers and categorized based on their criticality. an invalid string may be entered in a Textbox that expects a number. Well. thats danger! 2) Exceptions . 3) End User Errors . They may be difficult to prevent at times.

What is OOPs? OOPs . relational databases and XML. an application may be hacked or damaged using SQL injections. pronounced simply as 'link' is a component of the Microsoft . For example. LINQ is being used to query a simple array containing integers: int[] values = new int[] {4. Note: For writing code in C# that understands the LINQ syntax. filter and project data in arrays.Object Oriented Programming Languages & Systems Everything in the world is an object. The information returned by a LINQ query is a collection of in-memory object which may be enumerated.NET 3. it first needs to be converted to an object in order for LINQ to query it. The syntax is kind of similar to SQL. It serves the purpose of querying objects. It is one of the most powerful features of .terrible nightmares. if at all. So we may say.NET Framework that enhances . LINQ has been released along with the .6. foreach(int j in values) Response. The LINQ concept treats the data source as an Object. the System. enumerable classes. • LINQ querying Datasets (Querying is possible on Datasets and DataTables) • LINQ querying ORM Solution • LINQ querying Objects (In-memory data may be queried) • LINQ querying XML (Querying is possible on XML data source LINQ supports querying to those objects that implement the IEnumerable Interface.5 Framework.NET based languages with data Querying power.7}. LINQ comprises a series of operators.5. the data needs to be encapsulated as an object.Write(j). its an object that is queried. input boxes allow bad input that may crack the code. In order to query data.Linq namespace needs to be used. like: • LINQ querying SQL (MS SQL Server supported).NET 3. we . In the example code below. The type of the object may vary.5. In case the data source is not an object. var output = from i in values where i < 4 orderby i select i. LINQ has its own Query Processing Engine. In OOPS. which are used to query. rather than a Database. LINQ may query any type of data source. What is LINQ? Language Integrated Query (LINQ).

when a button is clicked. We make use of Get and Set keywords while working with properties. it is defined using the keyword virtual (otherwise the sealed keyword is used to prevent overriding). we might think we could declare a public variable in a class and call it a property. we say it is the click( ) event. We prefix the variables used within this code block with an underscore. For example. we say the mouseover( ) event has taken place. Difference between class & object What is a property? What is an event? Property . Looking at this definition. It is a method of computer programming where entities of related data together with routines associated with it are treated as one object in the program. this instantiated class entity is called the object. as & when required. When something happens. When we instantiate a class in order to use its encapsulated class members. properties. When a mouse hovers on an image. What is the virtual keyword used for? Virtual .ss="a"> Private _Color As String Public Property Color() Get Return _Color End Get Set(ByVal Value) _Color = Value End Set End Property Event . Value is a keyword.get the power to create objects of our own. Note that the class member method may be overriden even if the virtual keyword .A property is a thing that describes the features of an object. that holds the value which is being retrieved or set. A property is a piece of data contained within a class that has an exposed interface for reading/writing. the real technical term for a public variable in a class is a field. A constructor of a class that resides within it is also a form of a class member. While this assumption is somewhat valid. What is a class member? What is an object? The entities like events.If a base class method is to be overriden.An action that an object does. The main difference between a field and a property is in the inclusion of an interface. OOPs is a programming methodology where each entity is an object. fields and functions encapsulated within a class are called class members. we say an event has happened.

//Calling base class method } } What is the difference between Casting and Parsing? Casting is just switching between different primitive data types. we may use the overridable keyword for this purpose. base.NET .is not used. When the override keyword is used to override the virtual method.SetSalary(money + managerIncentive). . Parsing is converting strings to primitive data types such as 'int'. Example: 'int' to 'short'. public class Employee { public virtual void SetBasic(float money) //This method may be overriden { Basic += money. Casting is an internal process that was designed to reduce overheads and execution errors. Casting requires an object. Parse requires a string for input. in a scenario where the base class method is required in a child class along with the overriden method. but its usage makes the code more transparent & meaningful. then the base keyword may be used to access the parent class member. A cast of an object reference requires validation that the Object actually is of the target type. The following code example will make the usage more clear. Example: String to ‘int’. In VB. } } public class Manager : Employee { public override void SetBasic(float money) //This method is being overriden { float managerIncentive = 10000. Parsing is the process of analyzing an input sequence in order to determine its grammatical structure.

it is used to explicitly hide a member from the base class. Constructors provide a way for classes to initialize a state for their members.This keyword may be used as a modifier and as an operator. it hides an inherited member from the base class member. } When a custom constructor is defined. Same apply for string and String. it creates an object on a heap to invoke constructors. What is the difference between Int32 and int? There is no difference between these two. //Creating an object of the type. //Creating a class object and invoking its constructor float amount = new float(). The Default Constructor of a class is without an argument. A constructor may also be overloaded. When used an a modifier. } \ public SomeClass(string str) { Console. The default constructor ensures that every member data is initialized to a default value. which is a checked exception you should do something with. When used as an operator. the Default Constructor is not called. See example. int is just an alias for Int32. public SomeClass() { Console. Note that constructors dont have a return type(not even void). Default Constructor is called"). Example SomeClass objSomeClass = new SomeClass(). As an operator. . What is a Private Constructor? Constructor . it can be used to create an object and then to invoke the constructor of the class.Parsing always has the possibility of a bad format exception. and invoking its constructor As a modifier.A constructor is a function with the same name as that of the class. What is a constructor? Explain the New Keyword.Writeline("Vishal says. See example below.Writeline("Vishal says. Custom Constructor is called" + str). New .

. which involves converting a stream of bytes into an object.. It is also used to create Singleton classes. This stream of bytes can be persisted.Example public class MamaClass { public void SomeMethod() { . } } public class BabyClass : MamaClass { new public void SomeMethod() { . They are usually used in classes that contain static members only. neither is it possible to create an instance of this class. a few things need to be kept in mind: * There is no access modifier require to define a static constructor * There may be only one static constructor in a class * The static constructor may not have any parameters * This constructor may only access the static members of the class * We may create more than one static constructor for a class Can a class be created without a constructor? No. What is Serialization? What is serializable attribute used for? Serialization . Serialization is used usually during remoting (while transporting objects) and to persist file objecst & database . introduced with C#.The process of converting an object into a stream of bytes. } } Private Constructor ... Example: public class SomeClass() { static SomeClass() { //Static members may be accessed from here //Code for Initialization } } While creating a static constructor.When a constructor is created with a private specifier. it is not possible for other classes to derive from this class. the class will access the no-argument constructor from its base class. The compiler will make this happen during compilation. See example below.It is a special type of constructor. Deserialization is an opposite process.. It gets called before the creation of the first object of a class(probably at the time of loading an assembly). What is a static constructor? Static Constructor . In case we dont define the constructor.

DataSets.objects. See example below..Add( "Whisky") colArrayList. The BinaryFormatter & SoapFormatter is used for Remoting. You can use the BinaryFormatter to serialize many.Add( "Vodka") colArrayList. has public read-write properties and has fields that can be serialized.Add( "Brandy") objFileStream = New FileStream(MapPath("C:\myArrayList. colArrayList)objFileStream.Binary Dim colArrayList As ArrayListDim objFileStream As FileStreamDim objBinaryFormatter As BinaryFormattercolArrayList = New ArrayList() colArrayList. While using XmlSerializer.IO Imports System. and Arrays but not other objects. such as DataReaders or TextBox controls. as the information is in binary format. Note that the XmlSerializer captures only the public members of the class. For example. it is required that the target class has parameter less constructors. The XmlSerializer enables us to serialize and deserialize objects to an XML format. whereas the XmlSerializer format is filled with XML tags.Formatters. you can serialize ArrayLists. The BinaryForamatter (and the SoapFormatter) has two main methods. To serialize a class. The output using the BinaryFormatter is quite compact. We also end up creating a file by the name .Create) objBinaryFormatter = New BinaryFormatterobjBinaryFormatter. Serialize and Deserialize. To Deserialize an object.. On deserialization. but not all. classes in the . we pass an instance of the stream and the object to the Serialize method. the constructor of the new object is not invoked. The BinaryFormatter has the same features as the SoapFormatter except that it formats data into binary format. SoapFormatter enables us to serialize & deserialize objects to SOAP format. FileMode. To serialize an object.Close() Here we see that an instance of the file stream (objFileStream) and an instance of the object (colArrayList) is passed to the Serialize method of the BinaryFormatter object (objBinaryFormatter)"). whereas the BinaryFormatter & the SoapFormatter captures both the public & private members of the class. Imports System.NET provides 2 ways for serializtion 1) XmlSerializer and 2) BinaryFormatter/SoapFormatter The XmlSerializer is used for Web Services. It can be used to construct objects from existing XML documents.Serialization. The XmlSerializer has good support for XML documents.Serialize(objFileStream. you pass an instance of a stream to the Deserialize method. the class must have the Serializable attribute or implement the ISerializable interface. The target class must be marked with the Serializable attribute.NET Framework. They can serialize private and public fields of a class. .

and write it to a disk.Deserialize( objFileStream ).it is a delegate that holds reference of more than one method.In order to deserialize an object.NET? DataView .. we have DataView object in ADO. the first parameter is the serialized object in the file stream format. . Note that the DefaultView property of a DataTable returns the Default data view for the DataTable.Just like we have Views in SQL (in our backend).Write( " " & strItem ) Next Here. Searching. and the second parameter is the desired type. Multicast Delegates must have a return type of void. Serializable .NET. see the code below… Dim colArrayList As ArrayListDim objFileStream As FileStreamDim objBinaryFormatter As BinaryFormatterDim strItem As String objFileStream = New FileStream( MapPath("myArrayList. and the class will act as if it is simply stored in the memory. What is a DataView in ADO. customized view of a DataTable object.Open ) objBinaryFormatter = New BinaryFormatter colArrayList = CType( objBinaryFormatter. ArrayList ) objFileStream.This is a class"). FileMode. Filtering. In scenarios like retrieval of a subset of data from a Datatable. Multicast Delegate .myArrayList.. A dataview may also be used to sort data that resides in it in ascending or descending order. A dataview object represents bindable. When we use this attribute with a class. Editing and Navigation may be performed on a DataView object. Finally. we may make use of DataViews to get this data. What is a delegate? What is a Multicast Delegate? Delegate . It is a type that holds the reference of a method. XmlSerializer does not serialize instances of classes like Hashtable which implement the IDictionary interface. the page iterates through all the elements of the ArrayList and displays the value of each element. an instance of this class can be taken in whatever state it is. Operations like Sorting. A delegate may be used to call a method asynchronously. In case a custom view of a DataTable has to be created on a DataView.Close() For Each strItem In colArrayList Response. then the RowFilter property of the DataView is set to the DefaultView.It is a type safe function pointer. CType takes in two parameters. Below is code on how to sort data in a dataview in ascending or descending on our hard-drive. The class can then be deserialized.

Why we use Temporary Tables? There are many cases where we need to create temporary tables in SQL Server and for various reasons. There are two types of temporary tables:  Local temporary tables:  Only available to the current connection to the database for the current login  They are dropped when the connection is closed  Global temporary tables:  Available to any connection upon their creation  They are dropped when the last connection using them is closed Code Example – Local Temporary Table CREATE TABLE #table_name ( column_name [DATATYPE] ) Code Example – Global Temporary Table CREATE TABLE ##table_name ( column_name [DATATYPE] } Temporary tables (local and global) are stored in the tempDB database.  Increase the performance of a SQL query. etc. objdv. .Sort("ColumnName Asc|Desc").DataView objdv = new DataView(). Such reasons may include:  Breaking the logic of a large and complex SQL Statement in smaller portions of code.

CommandType is also a property of Select Command. The CommandText and Connection are properties of the Select Command propety.This property is used to hold the SQL command that is used to retrieve data from the data source. Dim da as new SqlDataAdapter da.SelectCommand .CommandText = "select * from employees" End With . See example below.Connection = objConnection .SelectCommand = New SqlCommand( ) With da.NET? Select Command Property ...How to insert value in a table in SQL Server that has a single column as Identity ? Ans : INSERT INTO MyTable DEFAULT VALUES What is SelectCommand in ADO.