• +91 9971497814
  • info@interviewmaterial.com

Ado.net Interview Questions Answers

Question 1 : Normal 0 f

Answer 1 : There is a method that helps in getting schema information that is GetSchema() and this method is called in three different ways first way when we call this method without any parameter its return the metadata(table, view, stored procedure.indexes etc).When method is called by passing metadata collection name and filter criteria returns the items from the collection after applying the filter criteria and last way is when we called by passing a metadata collection name returns information about items found in the specified collection.

Question 2 :   Between Windows Authentication and SQL Server Authentication, which one is trusted and which one is untrusted?

Answer 2 : Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.

Question 3 :   Explain ACID rule of thumb for transactions.

Answer 3 :   A transaction must be: 1.       Atomic - it is one unit of work and does not dependent on previous and following transactions. 2.       Consistent - data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t. 3.       Isolated - no transaction sees the intermediate results of the current transaction). 4.       Durable - the values persist if the data had been committed even if the system crashes right after. 

Question 4 :   What connections does Microsoft SQL Server support?

Answer 4 :   Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and password).

Question 5 :   What does the Initial Catalog parameter define in the connection string?

Answer 5 : The database name to connect to.

Question 6 : Can you edit data in the Repeater control?

Answer 6 : NO.

Question 7 : Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?

Answer 7 :   Let’s take a look at the differences between ADO Recordset and ADO.Net DataSet: 1. Table Collection: ADO Recordset provides the ability to navigate through a single table of information. That table would have been formed with a join of multiple tables and returning columns from multiple tables. ADO.NET DataSet is capable of holding instances of multiple tables. It has got a Table Collection, which holds multiple tables in it. If the tables are having a relation, then it can be manipulated on a Parent-Child relationship. It has the ability to support multiple tables with keys, constraints and interconnected relationships. With this ability the DataSet can be considered as a small, in-memory relational database cache. 2. Navigation: Navigation in ADO Recordset is based on the cursor mode. Even though it is specified to be a client-side Recordset, still the navigation pointer will move from one location to another on cursor model only. ADO.NET DataSet is an entirely offline, in-memory, and cache of data. All of its data is available all the time. At any time, we can retrieve any row or column, constraints or relation simply by accessing it either ordinarily or by retrieving it from a name-based collection. 3. Connectivity Model: The ADO Recordset was originally designed without the ability to operate in a disconnected environment. ADO.NET DataSet is specifically designed to be a disconnected in-memory database. ADO.NET DataSet follows a pure disconnected connectivity model and this gives it much more scalability and versatility in the amount of things it can do and how easily it can do that. 4. Marshalling and Serialization: In COM, through Marshalling Question 8 : Data Provider

Answer 8 : Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-langua

Question 9 : Define different execute methods of ADO.NET command object ?

Answer 9 : ExecuteScalar:- This method returns a single value from the first row and first column of the result get from the execution of SQL query. ExecuteNonQuery:- This method executes the DML SQL query just like insert, delete or update and then returns the number of rows affected by the action. ExecuteReader:- This method returns DataReader object which is a forward-only resultset. ExecuteXMLReader:- This method is available for SQL Server 2000 or later. Upon execution it builds XMLReader object from standard SQL query.

Question 10 : Define tool Manage Statistics in SQL Serevr 2000 query

Answer 10 : SQL Server creates internal statistics on the rows in all of our tables that is used by the Query Optimizer to select the optimal execution plan for our query. And Query Optimizer helps in doing this.Soome time when statistics isnot maintains then this is done by tool Manage Statistics.We can add,edit or delete for statistics that is maintained by SQL Server.We can experiment with different sets of statistics and see how it affects the query otimizer execution plans.

Ado.net Contributors

Rajeev Katiyar

Share your email for latest updates

Name:
Email:

Our partners