What is an ADO.Net?
ADO.Net is commonly termed as ActiveX Data Objects which is a part of .Net Framework. ADO.Net framework has set of classes which are used to handle data access by connecting with different databases like SQL, Access, Oracle, etc.…
What are two important objects of ADO.Net?
There are two important objects of ADO.Net:
What are the namespaces used in ADO.Net to connect to a database?
Following namespaces are used to connect to Database.
- The System.Data namespace.
- The System.Data.OleDb namespace – A data provider used to access database such as Access, Oracle, or SQL.
- The System.Data.SQLClient namespace – Used to access SQL as the data provider.
What is LINQ?
LINQ is native query language for .NET framework and it is specially designed to support queries with the .net applications. LINQ can be connected to SQL and MS Access.
What are the data providers in ADO.NET framework?
Below Data Providers are used in ADO.NET framework.
- .NET Framework Data Provider for SQL Server – A Data provider that provides access to Microsoft SQL Server 7.0 or later version and it uses the System.Data.SqlClient namespace.
- .NET Framework Data Provider for OLE DB – A Data Provider that provides access to any database exposed by using OLE DB and it uses the System.Data.OleDb namespace.
- .NET Framework Data Provider for ODBC – A Data Provider that provides access to any databases exposed by using ODBC and It uses the System.Data.Odbc namespace.
- .NET Framework Data Provider for Oracle – A Data Provider that provides access to Oracle database 8.1.7 or later versions and it uses the System.Data.OracleClient namespace.
What is Data Reader Object?
Data reader is an object of ADO.Net which provides access to data from a specified data source. It consists of classes which sequentially read data from a data source like Oracle, SQL or Access.
What is Dataset Object?
A Dataset is set to be collection of data with a tabular column representation. Each column in the table represents a variable and the row represents to value of a variable. This Dataset object can be obtained from the database values.
What is object pooling?
Object pooling is nothing but a repository of the objects in memory which can be used later. This object pooling reduces the load of object creation when it is needed. Whenever there is a need of object, object pool manager will take the request and serve accordingly.
What is connection pooling?
Connection pooling consists of database connection so that the connection can be used or reused whenever there is request to the database. This pooling technique enhances the performance of executing the database commands. This pooling definitely reduces our time and effort.
What is Data view?
Data view is the representation of data in various formats and it can be requested by the users. Data can be exposed in different sort orders or filter on the user condition with the help of Data view. Data Customization is also possible through Data View.
What is Data Adapter?
Data Adapter is a part of ADO.NET data provider which acts as a communicator between Dataset and the Data source. This Data adapter can perform Select, Insert, Update and Delete operations in the requested data source.
What is the use of Sql Command object?
SQL Command object that allows user to interact with the database. This object mainly used to query the database and it can be of different types – Select, Insert, Modify and Delete.
What is the difference between ADO and ADO.Net?
ADO works with the connected data whereas ADO.Net works in a disconnected manner. ADO has main object called Record set which is used to reference data. But ADO.Net has various objects to access the database.
ADO allows creating client-side cursors whereas ADO.Net deals with both server side and server side cursors. ADO allows persisting records in XML format and ADO.Net allows to manipulate data using XML.
What are the benefits of ADO.Net?
Following are the benefits of ADO.Net:
- Programmability
- Maintainability
- Interoperability
- Performance
- Scalability
What is the use of connection object?
ADO.Net Connection object is used to establish a connection between application and the data source. SQL Commands can be executed once this connection has been established. It is mandatory to close the connection object once data base activities are completed.
What are all features of ADO.Net?
Following are the features of ADO.Net:
- Data Paging
- Bulk Copy Operation
- New Data Controls
- Data readers execute methods.
What is the difference between Response. Expires and Response. Expires Absolute?
Response. expires property specify the minutes of page in cache from the time, the request has been served from server.
But Response. Expires Absolute property provides exact time at which the page in cache expires.
Example –
Response. expires – Set to 10mins and it will stay in cache for 10mins from time it has been requested
Response. Expires Absolute – Oct 30 12:20:15. Till this specified time, Page will be in cache.
What is boxing and un boxing?
Conversion of value type to reference type is called Boxing and Conversion of reference to value type is called Un boxing. Boxing and Un boxing are used for type casting from value to reference type and vice versa.
What is the difference between Data reader and Dataset?
Following table gives difference between Data reader and Dataset:
Data reader |
Dataset |
Forward only |
Loop through Dataset |
Connected Record set |
Disconnected Record set |
Single table involved |
Multiple tables involved |
No relationship required |
Relationship between tables maintained |
No XML storage |
Can be stored as XML |
Occupies Less Memory |
Occupies More memory |
Read only |
Can do addition / Updation and Deletion |
Jack is having XML document and that needs to be read on a daily basis. Which method of XML object is used to read this XML file?
Read XML() method is used to read XML file.
Which method in OLEDB Adapter is used to populate dataset with records?
Fill Method is used to populate dataset with records.
Which object needs to be closed?
OLEDB Reader and OLDDB Connection object need to be closed. This will stay in memory if it is not properly closed.
What are different layers of ADO.Net?
There are three different layers of ADO.Net:
- Presentation Layer
- Business Logic Layer
- Database Access Layer
What are typed and un typed dataset?
Typed datasets use explicit names and data types for their members but untyped dataset uses table and columns for their members.
How to stop running thread?
Thread.Abort() function stops the thread execution at any time.
Which method is used to sort the data in ADO.Net?
Sort() method of Grid View Control is used to sort the data in a data table.
Which object is used to add relationship between two Data tables?
Data Relation object is used to add relationship between two or more data table objects.
Which is the best method to get two values from the database?
Execute Non-Query is the best method to get two values from the database.
What are all the classes that are available in System.Data Namespace?
Following are the classes that are available in System.Data Namespace:
- Data Table.
- Data Column.
- Data Row.
- Data Relation.
What are the uses of Stored Procedure?
Following are uses of Stored Procedure:
- Improved Performance.
- Easy to use and maintain.
- Less time and effort taken to execute.
- Less Network traffic.
What is the default Timeout for Sql Command. Commandtimeout property?
The default timeout of Sql command. Command Timeout property is 30 Seconds.
What are the classes in System. Data. Common Namespace?
There are two classes involved in System. Data. Common Namespace:.
- Data Column Mapping.
- Data Table Mapping.
Â