Ado.net Interview Questions and Answers
Question - 71 : - What are the differences between OLEDB and SQLClient Providers?
Answer - 71 : -
OLEDB provider is used to access any database and provides flexibility of changing the database at any time. SQLClient provider is used to access only SQL Server database but it provides excellent performance than OLEDB provider while connecting with SQL Server database.
Question - 72 : - What are the different execute methods of Ado.Net?
Answer - 72 : -
Following are different execute methods of ADO.Net command object:
- ExecuteScalar – Returns single value from the dataset
- ExecuteNonQuery – Returns result set from dataset and it has multiple values
- ExecuteReader – Forwardonly resultset
- ExecuteXMLReader – Build XMLReader object from a SQL Query
Question - 73 : - What are all the commands used with Data Adapter?
Answer - 73 : -
DataAdapter is used to retrieve data from a data source .Insertcommand, UpdateCommand and DeleteCommand are the commands object used in DataAdapter to manage update on the database.
Question - 74 : - What are the classes in System.Data.Common Namespace?
Answer - 74 : -
There are two classes involved in System.Data.Common Nameapce:.
- DataColumnMapping.
- DataTableMapping.
Question - 75 : - What is the default Timeout for SqlCommand.CommandTimeout property?
Answer - 75 : -
The default timeout of Sqlcommand. CommandTimeout property is 30 Seconds.
Question - 76 : - What are the uses of Stored Procedure?
Answer - 76 : -
Following are uses of Stored Procedure:
- Improved Performance.
- Easy to use and maintain.
- Security.
- Less time and effort taken to execute.
- Less Network traffic.
Question - 77 : - What are all the classes that are available in System.Data Namespace?
Answer - 77 : -
Following are the classes that are available in System.Data Namespace:
- Dataset.
- DataTable.
- DataColumn.
- DataRow.
- DataRelation.
- Constraint.
Question - 78 : - Which is the best method to get two values from the database?
Answer - 78 : -
ExecuteNonQuery is the best method to get two values from the database.
Question - 79 : - Which object is used to add relationship between two Datatables?
Answer - 79 : -
DataRelation object is used to add relationship between two or more datatable objects.
Question - 80 : - Which method is used to sort the data in ADO.Net?
Answer - 80 : -
Sort() method of GridViewControl is used to sort the data in a datatable.