CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.




Get it now !!
Send your Resume to 6000 Companies
ADO.NET Interview Questions & Answers - Learning Mode
COOLINTERVIEW.COM MICROSOFT INTERVIEW QUESTIONS ADO.NET INTERVIEW QUESTIONS QUESTIONS & ANSWERS - LEARNING MODE

ADO.NET Interview Questions & Answers - Learning Mode

ADO.NET provides consistent access to data sources such as Microsoft SQL Server, as well as data sources exposed through OLE DB and XML. Data-sharing consumer applications can use ADO.NET to connect to these data sources and retrieve, manipulate, and update the databases.

Try ADO.NET Interview Questions & Answers - Exam Mode

1 2 3 4 5 Next

Sort By : Latest First | Oldest First | By Rating

ADO.NET Interview Questions & Answers - Learning Mode
Try ADO.NET Interview Questions & Answers - Exam Mode
Question: Can we connect two datareader to same data source using single connection at same time?



Answer: Yes, you can connect two datareader to the same datasource, but one mainthing is close the first datareader before using second one then only it's possible.
Source: CoolInterview.com
Question: What is the difference between ADO and ADO.NET?

Answer: ADO is used in windows based application and ADO.NET is used in web based application. Source: CoolInterview.com
Question: How do I insert records using data reader?

Answer: The procedure for updating records using INSERT commands is very similar to the one we presented in the previous example (of SELECT) except that here the command does not return anything and thus the method to call on the SqlCommand object is called ExecuteNonQuery().

C# Version

string connString = "server=FARAZ; database=programmersheaven;" +
"uid=sa; pwd=";
SqlConnection conn = new SqlConnection(connString);

// INSERT Query
string cmdString ="INSERT I Source: CoolInterview.com
Question: Difference between SqlCommand and SqlCommandBuilder



Answer: SQLCommand is used to retrieve or update the data from database.

You can use the SELECT / INSERT,UPDATE,DELETE command with SQLCommand. SQLCommand will execute these commnds in the database.

SQLBUILDER is used to build the SQL Command like SELECT/ INSERTR, UPDATE etc.
Source: CoolInterview.com
Question: What is the difference between data reader and data adapter.



Answer: 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 di Source: CoolInterview.com
Question: How to copy the contents from one table to another table and how to delete the source table in ado.net?



Answer: May be there is a better way, but you can generating a datatable from source and load it to destination if the process is successful, execute the drop table query. Source: CoolInterview.com
Question: What is difference between Dataset.Clone and Dataset.Copy?

Answer: Dataset.Clone only copies the schema of a DataSet object like relations between data tables and constraints. Dataset.Copy copies both the data and structure of a DataSet object. Source: CoolInterview.com
Question: What are major difference between classic ADO and ADO.NET ?

Answer: ADO

ADO have recordset
ADO objects communicate in binary mode
ADO supports mostly connection oriented models
Since ADO derives information about data implicitly at run time based on metadata, it is an expensive process.
Only Client Side Cursors are allowed in ADO.
ADO.Net

ADO.Net have Data Adapter and Data set
ADO.NET uses XML for passing the data
ADO.Net works in Disconnected manner
By leveraging known meta data at design time, ADO.Net provide better runtim Source: CoolInterview.com
Question: Explain about the relationship of XML and ADO.NET?

Answer: ADO.NET utilizes the power of XML by providing disconnected access to data. This is designed with the help of XML classes in .NET Framework which form the components of single architecture. Source: CoolInterview.com
Question: What is the architecture of connected environment of data access in ADO.Net?

Answer: The connected environment of data access is the traditional procedure for accessing data programmatically. The differentiating property of the connected data access environment is that here you (the programmer) is required to manage the connection with the database. You can only perform database operations when, there exists an open connection to the database. Hence, before performing any database operation (select, update, insert, delete), the programmer opens a database connection and close th Source: CoolInterview.com
Question: What are good ADO.NET object(s) to replace the ADO Recordset object?


Answer: he differences includes
In ADO, the in-memory representation of data is the Recordset.
In ADO.net, it is the dataset

A recordset looks like a single table in ADO
In contrast, a dataset is a collection of one or more tables in ADO.net

ADO is designed primarily for connected access
ADO.net the disconnected access to the database is used

In ADO you communicate with the database by making calls to an OLE DB provider.
In ADO.NET you communicate with the database th Source: CoolInterview.com
Question: What is the role of the DataReader class in ADO.NET connections?

Answer: It returns a read-only dataset from the data source when the command is executed. Source: CoolInterview.com
Question: What are the important features of ADO.Net 2.0 ?

Answer: Batch Update ? To update n no of rows in a database table in a single call from a program thus by avoiding round trip to database.
Data Paging ? To read data from a certain index
Connection Details ? To get detailed info about connections like buffer information, cursor details etc.
DataSet.RemotingFormat Property ? To make dataset serialized in Binary
DataTable's Load and Save Methods ? For XML interactions. Source: CoolInterview.com
Question: How can I make my first application with DataGrid using the data from ADO.Net?

Answer: Let?s create a simple application first that loads a table data from database server to the data grid control. First of all, add a data grid control and a button to your form from Visual Studio toolbox. We have set the Name property of data grid to ?dgDetails? and its CaptionText property to ?ProgrammersHeaven Database?. The name of button is ?btnLoadData?. The event handler for button is:

C# Version

private void btnLoadData_Click(object sender, System.EventArgs e)
{
string Source: CoolInterview.com
Question: How do I call a stored procedure from my application using ADO.Net?

Answer: Using stored procedures with ADO.Net in C# is extremely simple, especially when we have developed the application with SQL commands. All we need is:

* Create a command object (SqlCommand, etc) and specify the stored procedure name
* Set the CommandType property of the command object to the CommandType.StoredProcedure enumeration value. This tells the runtime that the command used here is a stored procedure.

That?s it! The sample code to use with data adapter is:

C Source: CoolInterview.com
Question: Explain LINQ to Entities?

Answer: This feature allows LINQ query capabilities and it specifically forms a part of the .NET framework. This feature allows developers to program in ADO.NET and ORM. This feature also allows access to third party database. This provides new features to entity data. Source: CoolInterview.com
Question: How can you find a problem in the data stack?

Answer: Problem can arise from these following instances they are: -
1) Mismatch of schema between the client and database.
2) Network library problems or non existence of data.
3) Wrong SQL generated.
4) Wrong programming logic. Source: CoolInterview.com
Question: How do I save the changes, made in the dataset, to the database?


Answer: We update the dataset and table by calling the Update method of the data adapter. This saves the changes in the local repository of data: dataset. To save the changed rows and tables to the physical database, we call the AcceptChanges() method of the DataSet class.
C# Version
dataAdapter.Update(ds, "student");
ds.AcceptChanges();
VB.Net Version
da.Update(ds, "student")
ds.AcceptChanges()
Here ?da? is the reference to the data adapter object, ?ds? is the reference to the data Source: CoolInterview.com
Question: How do different components of ADO.Net interact with each other in disconnected architecture?

Answer: The Data Adapter contains in it the Command and Connection object. It uses the connection object to connect to the database, execute the containing command, fetch the result and update the DataSet. Source: CoolInterview.com
Question: How do I write common code for different dot net framework data providers?

Answer: The System.Data namespace contains the interfaces implemented by different dot net framework data providers, such as:

* IDbConnection implemented by SqlConnection, OracleConnection, OleDbConnection, OdbcConnection classes represents a connection with the database server
* IDbCommand implemented by SqlCommand, OracleCommand, OleDbCommand, OdbcCommand classes represents an SQL command passed to the database server
* IDbDataAdapter implemented by SqlDataAdapter, OracleDataA Source: CoolInterview.com

1 2 3 4 5 Next



India News Network
Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
Cache = 0.03125 Seconds