Skill : Ado.Net
Questions : 40
Type: Job Interview Questions

40 MOST ASKED ADO.NET INTERVIEW QUESTIONS AND ANSWERS PDF

How to find the count of records in a dataset?

DS.Tables[“tabname”].Rows.Count;
we can get count of the records.

What is data Adapter?

Data adapter is bridge between Connection and DataSet , Data adapter in passing the sql query and fill in dataset.

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.

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.

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.

What is the provider and namespaces being used to access oracle database?

The provider name is oledb and the namespace is system.data.oledb

What provider ADO.net use by default?

Ado.net uses no Dataprovider by default and this is absulotely correct answer. there is no other choice for this questions.

What we do with the object of ado.net dataset after using it?Can we dispose it or can we set it nothing?Is it must or not?

we use dispose.

What are the two fundamental objects in ADO.NET?

Datareader and Dataset are the two fundamental objects in ADO.NET

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.

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.

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.

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).

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.

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();
I loaded the dataset with a table of 10 records. One of the records is deleted from the backend, How do you check whether all the 10 records were present while updating the data(Which event and steps) and throw the exception.

By Using the Transactions we can check the Exact Numbers of the rows to be updated and if the updation fails then the Transaction will be rollbacked.

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.

How to call the SQL commands asynchronously in ADO.NET version 2.0?

executescalar()
executereader()
executenonquery()
these comes with Begin and End like Beginexecutescalr() Endexecutescalar()…….
by using these command we can achieve asynch comm in ado.net

How to copy the contents from one table to another table and how to delete the source table in ado.net?

it is possible
DataSet ds;
sqlAdap.Fill(ds);
Datatable dt = ds.Tables[0].copy();
//now the structure and data are copied into ‘dt’
ds.Tables.remove(ds.Table[0]);
//now the source is removed from the ‘ds’

How to find the given query is optimised one or not?

First Excute Sql Quries in Query Analzer,see How much time 2 take Excute , if Less then the ur desired Time, then it will Optimize query

Why canot 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.

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.

why edit is not possible in repeater?

It has no such feature.

Does SQLClient and OLEdb class share the same functionality?

No, each have its own functionality,
ex : for sql client , there is SqlConnection object and for oledb client , there is OleDBConnection

What is the difference between data reader and data set?
  • DataSet is disconnected object type. It uses XML to store data.
  • It fetches all data from the data source at a time
  • Modifications can be updated to the actual database
  • It will reduce the application performance.
What is the difference between data reader and data adapter?

DateReader is an forward only and read only cursor type if you are accessing data through DataRead it shows the data on the web form/control but you can not perform the paging feature on that record(because it’s forward only type). Reader is best fit to show the Data (where no need to work on data)DataAdapter is not only connect with the Databse(through Command object) it provide four types of command (InsertCommand, UpdateCommand, DeleteCommand, SelectCommand), It supports to the disconnected Architecture of .NET show we can populate the records to the DataSet. where as Dataadapter is best fit to work on data.

What are the advantages and disadvantages of using datalist?

Adv: the DataList’s display is defined via templates,DataList allows for much more customization of the rendered HTML markup , by which it is more user-friendly displays of data.
DisAdv:
adding such functionality with the DataList takes more development time than with the DataGrid, as,

  • The Edit/Update/Cancel buttons that can be created in a DataGrid via the EditCommandColumn column type, must be manually added to the DataList, and
  • The DataGrid BoundColumn column types automatically use a TextBox Web control for the editing interface, whereas with the DataList you must explicitly specify the editing interface for the item being edited via the EditItemTemplate.
  • we can’t do the paging and sorting with datalist controls.
What is Partial class?

A Partial class is a class that can be split into two or more classes. This means that a class can be physically separated into other parts of the class within the same namespace. All the parts must use the partial keyword. All the other classes should also have the same access modifier. At the compile time, all the partial classes will be treated as a single class. Let us list some advantages of having partial classes.

How do you connect to SQL Server Database without using sqlclient?

you can connect sql using oledbname space.

What are the steps to connect to a database?
  • Create a connection. This requires a connection string, which can be given declarative or put in a well defined place like the .config files. Advantage of keeping in .config files is that it enables use of Connection Pooling by .Net framework, else even one small change in connection string will cause CLR to think it’s not the
    same connection and will instantiate new connection for other request.
  • Open the connection and keep it open until done, typically done as using (con) { //use }
  • If using connected data model, create a SqlCommand object, decorate it with desired command, command type (stored procedure for eg), add any parameters and their values to the command, and then consume the command by using ExcuteReader or ExecuteScalar. In case of ExecuteReader, we will get back a handle to a fast-forward, read
    only pointer to the recordset. We can also decorate Command object with multiple recordsets in 2.0 and execute one by one (MARS – Multiple Active Record Sets)
  • If using disconnected data model, create a DataAdapter object, decorate it with desired SELECT, INSERT, UPDATE, DELETE commands, add parameters as necessary and then fill up a DataSet or DataTable using the DataAdapter. Subsequent SQL can be executed using insert, update, delete commands on the dataset.
Interview Questions On ADO.NET For Experienced, ADO.NET Interview Questions For Experienced, ADO.NET Interview Questions For 3 Years Experienced, ADO.NET Interview Questions And Answers For 1 Year Experienced, ADO.NET Interview Questions With Answers, ADO.NET Interview Questions And Answers Sample, ADO.NET Interview Questions And Answers For Freshers, ADO.NET Interview Questions And Answers Pdf Download, ADO.NET Interview Question And Answer C#, ADO.NET Interview Questions And Answers in Asp.Net, Interview Questions And Answers in ADO.NET, ADO.NET Fresher Interview Questions And Answers, ADO.NET Entity Framework Interview Questions And Answers Pdf, ADO.NET Basic Interview Questions And Answers, ADO.NET Interview Questions And Answers For 3 Years Experienced, ADO.NET Interview Questions And Answers For 3 Years Experience Pdf, ADO.NET Interview Questions And Answers For 5 Years Experienced, What Is Ado Net Interview Questions And Answers, Top 50 ADO.NET Interview Questions And Answers, Top 10 ADO.NET Interview Questions And Answers, Top ADO.NET Interview Questions And Answers, ADO.NET Technical Interview Questions And Answers, ADO.NET Interview Questions And Answers Pdf, ADO.NET Practical Interview Questions And Answers, ADO.NET Interview Questions And Answers For 2 Years Experience Pdf, ADO.NET Technical Interview Questions And Answers Pdf, Interview Questions And Answers On Ado Net, Interview Questions And Answers On ADO.NET For Experienced, Latest ADO.NET Interview Questions And Answers, Interview Questions And Answers For Freshers in ADO.NET, Ado Net Interview Questions And Answers For Freshers, ADO.NET Interview Questions And Answers For Freshers Pdf, ADO.NET Interview Questions And Answers For Experienced, ADO.NET Interview Questions And Answers For 3 Years Experience, ADO.NET Entity Framework Interview Questions And Answers, Ado Net Interview Questions And Answers For 2 Years Experience, ADO.NET Interview Questions And Answers For 4 Years Experience, ADO.NET Interview Questions And Answers For Experienced Pdf, ADO.NET 3.5 Interview Questions And Answers For Experienced, ADO.NET Interview Questions And Answers For Experience Pdf, Ado Net Interview Questions And Answers For 1 Years Experience, ADO.NET Interview Questions And Answers With Examples, ADO.NET Interview Questions And Answers For Freshers Pdf Free Download, ADO.NET Interview Questions And Answers Pdf Free Download, Ado Dot Net Interview Questions And Answers, ADO.NET Multiple Choice Interview Questions And Answers, ADO.NET Interview Questions And Answers Codeproject, Basic ADO.NET Interview Questions And Answers, Basic .Net Asp.Net ADO.NET Oops And Sql Server Interview Questions And Answers, Asp.Net ADO.NET Interview Questions And Answers, Asp.Net ADO.NET Interview Questions And Answers Pdf, Frequently Asked Interview Questions And Answers On ADO.NET

.