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.
 
Your Name Your Email-ID
Your Answer
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
 
Your Name Your Email-ID
Your Answer
28. How to creating a SqlConnection Object?
  SqlConnection conn = new SqlConnection("Data Source=DatabaseServer;Initial Catalog=Northwind;User ID=YourUserID;Password=YourPassword");
 
Your Name Your Email-ID
Your Answer
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);
 
Your Name Your Email-ID
Your Answer
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";
 
Your Name Your Email-ID
Your Answer
123456789101112


13141516 Page 6 of 16