Ado.Net Interview Questions and Answers Part 4

By
1. ) What is DataTable collection in Ado.Net ?                                                                  
The Data Tables collection contains all the Data Table objects in a DataSet.

2. ) What is the use of Data view in Ado.Net ?                                                                    

Data View is mainly used to sort and filter the Table data.

3. )Can we return a result set using ExecuteNonQuery() method  in Ado.Net ?    

No, It only show "Row effected " when any user perform insert ,delete and update operation on a table.We use ExecuteReader() method for return the result set from Database.

4. ) Explain the different methods and properties of Data Reader in Ado.Net ?  
  • Read()
  • GetString()
  • GetInt32()
5. ) What happens when we use Dataset.ReadXml command ?                                   
It Reads XML Schema and data into the Data Set.

6. ) How to check whether a Data Reader is opened or closed  ?                                   
IsClosed()

7. ) How to retrieve records counts in DataSet   ?                                                               
Foreach(DataTable this_table in myDataset.Tables)
{
.................
}

8. ) How to print the values of each column in table ?                                                    
Foreach(DataRow this_row in thisTable.Rows)
{
........................
}

9. ) What Method is used to fill the Dataset in ado.net  ?                                              
DataAdopter_obj.Fill()

10. ) What Method is used to get XML data  and schema from dataset?               

  • GetXML()
  • GetSchema()
11. ) What are the Namespace used for connectivity in ado.net?               
  • System.Data.SqlClient
  • System.Data.OracleClient
  • System.Data.oleDB
  • System.Data.ODBC;

0 comments:

Post a comment

Powered by Blogger.