Ado.Net Interview Questions and Answers for Experienced - 2

Question: 6

Mention the namespace that is used to include.NET Data Provider for SQL Server in .NET code?

The System.Data.SqlClient namespace.

Question: 7

What is the difference between OLEDB provider and SqlClient?

With respect to usage, there is no difference between OLEDB provider and SqlClient. The difference lies in their performance. SqlClient is explicitly used to connect your application to SQL server directly. OLEDB provider is generic for various databases, such as Oracle and Access including SQL Server. Therefore, there will be overhead which leads to performance degradation.

Question: 8

What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?

You must set the DataSource property and call the DataBind() method.

Question: 9

What are the various methods provider by the DataSet object to generate XML?

The various methods provided by the DataSet object to generate XML are:
Readxml () – Reads XML document into a DataSet object
Getxml() – Returns a string containing an XML document
WriteXml() – Writes an XML data to disk.

Question: 10

How would you connect to a database by using .NET?

The Connection class is used to connect a .NET application with a database.

Related Questions