Q. What is DataAdapter in asp.net?
A. DataAdapter helps in linking the database and connection object. DataAdapter provides the communication between Dataset and data sources.
Data moves ‘in and out’ of the Dataset through DataAdapter.
Properties of DataAdapter that allow the user to control the database are:
Select Command
Update Command
Insert Command
Delete Command.
Q. What are DataReaders in asp.net c# web application development?
A. DataReader object is ‘stream-based’, ‘read-only’ and ‘forward-only’, which provides a connection based data access from a database. This contains a ‘Read ()’ method that retrieves the data stored in a data source.
A Connection Object has only one DataReader at a time. ‘Read ()’ method retrieves only one row at a time. That is data need not be completely read into the application before it is processed.
Q. Explain “static” keyword in C#?
A. “Static” keyword can be used for declaring a static member. If the class is made static then all the members of the class are also made static. If the variable is made static then it will have a single instance and the value change is updated in this instance.
Q. What are Cookies in ASP.NET?
A. Cookies are a State Management Technique that can store the values of control after a post-back. Cookies can store user-specific Information on the client's machine like when the user last visited your site. Cookies are also known by many names, such as HTTP Cookies, Browser Cookies, Web Cookies, Session Cookies and so on. Basically cookies are a small text file sent by the web server and saved by the Web Browser on the client's machine.
List of properties containing the HttpCookies Class:
Domain: Using these properties we can set the domain of the cookie.
Expires: This property sets the Expiration time of the cookies.
HasKeys: If the cookies have a subkey then it returns True.
Name: Contains the name of the Key.
Path: Contains the Virtual Path to be submitted with the Cookies.
Secured: If the cookies are to be passed in a secure connection then it only returns True.
Value: Contains the value of the cookies.
Limitation of the Cookies
The size of cookies is limited to 4096 bytes.
A total of 20 cookies can be used in a single website.
Q. Tell the difference between “dispose” and “finalize” variables in C# asp.net?
A. Dispose - This method uses interface – “IDisposable” interface and it will free up both managed and unmanaged codes like – database connection, files etc.
Finalize - This method is called internally unlike Dispose method which is called explicitly. It is called by garbage collector sand can’t be called from the code.
Q. How the exception handling is done in C# asp.net?
A. In C# there is a “try – catch - finally” block to handle the error.
#asp.net #online #course