ADO.NET

  Home  Microsoft .Net Technologies  ADO.NET


“ADO.NET Interview Questions and Answers will guide us now that ADO.NET is a set of computer software components that can be used by programmers to access data and data services. It is a part of the base class library that is included with the Microsoft .NET Framework. It is commonly used by programmers to access and modify data stored in relational database systems, though it can also be used to access data in non-relational sources. Learn ADO.NET with ADO.NET Interview Questions and Answers”



42 ADO.NET Questions And Answers

21⟩ Difference between SqlCommand and SqlCommandBuilder?

a) SQLCommand is used to execute all kind of SQL queries like DML(Insert, update,Delete) & DDL like(Create table, drop table etc)

b)SQLCommandBuilder object is used to build & execute SQL (DML) queries like select, insert, update & delete.

 192 views

22⟩ Why ca not we use Multiple inheritance and garbage collector paralelly in .net?

.net doesn't support the mutiple inheritance, perhaps you may talk about multi-level inheritance.

In the later case, if a class is inherited from another class, at the time of creating instance, it will obviously give a call to its base class constructor (ie bottom - top approach). Like wise the constructor execution is takes place in top down approach (ie. base class constructor is executed and the derived class constructor is executed).

So for GC, it will collect only when an object does not have any reference. As we see previously, the derived is constructed based on base class. There is a reference is set to be. Obviously GC cannot be collected.

 154 views

26⟩ what is typed and untyped dataset?

A DataSet can be Typed or Untyped. The difference between the two lies in the fact that a Typed DataSet has a schema and an Untyped DataSet does not have one. It should be noted that the Typed Datasets have more support in Visual studio.

 203 views

28⟩ Can dataReader hold data from multiple tables?

data reader can hold data from multiple tables and datareader can hold more than one table.

string query="select * from employee; select * from student";

sqlcommand cmd=new sqlcommand(query, connection);

sqldatareader dr=cmd.executeReader();

if(dr.hasrows)

{

dr.read();

gridview1.DataSource=dr;

gridview1.Databind();

if(dr.nextresult)

{

gridview2.datasource=dr;

gridview2.databind();

}

}

dr.colse();

connection.close();

 160 views

29⟩ What is different between SqlCommand object and Command Behavior Object?

DO.NET Command Object - The Command object is similar to the old ADO command object.

It is used to store SQL statements that need to be executed against a data source.

The Command object can execute SELECT statements, INSERT, UPDATE, or DELETE statements, stored procedures, or any other statement understood by the database.

 186 views

30⟩ what is bubbled event can u pls explain?

all heavy controls like grid view,datagrid or datalist,repeater controls cantains the chield controls like button or link button, when we click this button then the event will be raised, that events are handled by parant controls,that is called event bubbling,means event is bubbled from bottom(chield)to up(parant).

 157 views

31⟩ If a table contains 20000 records . In a page at each time 100 records to be displayed. What are the steps u will take to improve performance? will you use dataset or datareader?

we have to use a dataset because on using datareader forward only paging can be achieved.

Suppose if you are at 1000 page and you want to go back to 999th page, if you use datareader it cannot be achieved, since it does not support backward navigation.

Dataset supports forward and backward navigation

 178 views

32⟩ What is data access layer?

Data Access layer is actually a part of Architecture layer. It has 2 tier,3 tier or N tier Layer. Generally we use 3 tier Layer 1) Presentation layer,Business Logic layer and then Data Access Layer. Data Access layer is a medium to talk between database and Business Logic layer.

It helps to maintain flexibility,resuablity and even secuity also. In security SQL Injection can be stopped with 3 iter Archietcture.

 202 views

33⟩ What are the different row versions available in table?

There are four types of Rowversions.

Current:

The current values for the row. This row version does not exist for rows with a RowState of Deleted.

Default :

The row the default version for the current DataRowState. For a DataRowState value of Added,

Modified or Current, the default version is Current. For a DataRowState of Deleted, the version is Original.

For a DataRowState value of Detached, the version is Proposed.

Original:

The row contains its original values.

Proposed:

The proposed values for the row. This row version exists during an edit operation on a row, or for a

row that is not part of a DataRowCollection.

 180 views

38⟩ Explain acid properties?

The term ACID conveys the role transactions play in mission-critical applications. Coined by transaction processing pioneers, ACID stands for atomicity, consistency, isolation, and durability.

These properties ensure predictable behavior, reinforcing the role of transactions as all-or-none propositions designed to reduce the management load when there are many variables.

 154 views

39⟩ What is Atomicity?

A transaction is a unit of work in which a series of operations occur between the BEGIN TRANSACTION and END TRANSACTION statements of an application. A transaction executes exactly once and is atomic ?

all the work is done or none of it is.

Operations associated with a transaction usually share a common intent and are interdependent.

By performing only a subset of these operations, the system could compromise the overall intent of the

transaction. Atomicity eliminates the chance of processing a subset of operations.

 121 views

40⟩ What is Isolation?

A transaction is a unit of isolation ? allowing concurrent transactions to behave as though each were the only transaction running in the system.

Isolation requires that each transaction appear to be the only transaction manipulating the data store, even though other transactions may be running at the same time. A transaction should never see the intermediate stages of another transaction.

Transactions attain the highest level of isolation when they are serializable. At this level, the results obtained from a set of concurrent transactions are identical to the results obtained by running each transaction serially.

Because a high degree of isolation can limit the number of concurrent transactions, some applications reduce the isolation level in exchange for better throughput.

 150 views