ADO.Net Interview Question and Answers
26. |
What is the DataTableCollection? |
|
An ADO.NET DataSet contains a collection of zero or more tables represented by DataTable objects. The DataTableCollection contains all the DataTable objects in a DataSet. |
|
|
27. |
What are the benefits of ADO.NET? |
|
ADO.NET offers several advantages over previous versions of ADO and over other data access components. These benefits fall into the following categories:- Interoperability
- Maintainability
- Programmability
- Performance
- Scalability
|
|
|
28. |
How to creating a SqlConnection Object? |
|
SqlConnection conn = new SqlConnection("Data Source=DatabaseServer;Initial Catalog=Northwind;User ID=YourUserID;Password=YourPassword"); |
|
|
29. |
How to creating a SqlCommand Object? |
|
It takes a string parameter that holds the command you want to execute and a reference to a SqlConnection object. SqlCommand cmd = new SqlCommand("select CategoryName from Categories", conn); |
|
|
30. |
How to load multiple tables into dataset? |
|
SqlDataAdapter da = new SqlDataAdapter("Select * from Id; Select * from Salry", mycon); da.Fill(ds); ds.Tables[0].TableName = "Id"; ds.Tables[1].TableName = "Salary"; |
|
|