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

Previous 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: 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: What does it mean by Dot Net Framework Data Provider?

Answer: Dot Net Framework Data Provider is a set of classes that establishes the database communication between an application and the database management system based on the standards of ADO.Net framework. Different data providers provide specialized and optimized connectivity to particular database management system or to a particular class of DBMS. For example, the MS SQL Server data provider provides the optimized connectivity between dot net application and MS SQL Server DBMS while the OLEDB data p 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
Question: What are the standard dot net framework data providers that are shipped with the Dot Net Framework 1.1?

Answer: The Dot Net Framework 1.1 is shipped with four different data providers:

* Dot Net Framework data provider for Microsoft SQL Server DBMS
* Dot Net Framework data provider for Oracle DBMS (available only in Framework 1.1)
* Dot Net Framework data provider for OLEDB supporting DBMS
* Dot Net Framework data provider for ODBC supporting data sources (available only in Framework 1.1)
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 does it mean by disconnected data access architecture of ADO.Net?

Answer: ADO.Net introduces the concept of disconnected data architecture. In traditional data access components, you make a connection to the database system and then interact with it through SQL queries using the connection. The application stays connected to the DB system even when it is not using DB services. This commonly wastes the valuable and expensive database resource as most of the time applications only query and view the persistent data. ADO.Net solves this problem by managing a local buffer Source: CoolInterview.com
Question: How do I make my first ?Hello, Data Access Application Deployment? setup program?

Answer: We will start with the assumption that you have a data access application. Note that we are only providing here the C# example. The VB.Net example is exactly similar. Why we didn?t include the VB.Net example? Because, the intent here is not to explain the code but the procedure of how to create the data accessing application?s deployment project which is independent of the language being used. All the code we will present here has already been presented in the previous FAQs and explained in much 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 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: What is ADO.Net?

Answer: Most of the today?s applications need to interact with database systems to persist, edit or view data. In .Net data access service is provided through ADO.Net (ActiveX Data Object in Dot Net) components. ADO.Net is an object oriented framework that allows you to interact with database systems. We usually interact with database systems through SQL queries or stored procedures. ADO.Net encapsulates our queries and commands to provide a uniform access to various database management systems.

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: What are the basic steps involved in data access with ADO.Net in disconnected environment?

Answer: Data access using ADO.Net involves the following steps:

* Defining the connection string for the database server
* Defining the connection (SqlConnection, OleDbConnection, etc) to the database using the connection string
* Defining the command (SqlCommand, OleDbCommand, etc) or command string that contains the query
* Defining the data adapter (SqlDataAdapter, OleDbDataAdapter, etc) using the command string and the connection object
* Creating a new DataSet Source: CoolInterview.com
Question: What are the issues related to the deployment of data access application?

Answer: Some of the basic issues related to the deployment of the data access applications are:

* Can we suppose the required database exists at the target location?
* If the database does exist then how can we get the connection string of it? Should we get it at the installation time? Or at the first run?
* If the database does not exist then how it can be created? Is it the responsibility of human installing our application? Or the application should create it at the time of i Source: CoolInterview.com
Question: Explain about LINQ?

Answer: Language integrated query or LINQ provides developers to query data. It uses strongly typed queries and results. Developer productivity increases by the usage of compile time error checking and intellisense. This feature is common on number of data types. Source: CoolInterview.com
Question: Explain SqlCommand Objects?

Answer: string Connection = "server=localhost; uid = UserName ; pwd = Password ; database = DemoDB";
SqlConnection con = new SqlConnection(Connection);
con.Open();

string select = "Select * from Employee_Table";
SqlCommand cmd = new SqlCommand(select, conn);
con.Close(); Source: CoolInterview.com
Question: How do stored procedure look like, can you provide some sample stored procedures?

Answer: Here we are presenting a brief review of four basic type of stored procedure for SELECT, INSERT, UPDATE and DELETE operations. In SQL Server, you can create and add stored procedures to your database using the SQL Server Enterprise Manager.

UPDATE Stored Procedure
A simple stored procedure to update a record is

CREATE PROCEDURE UpdateProc (
@artId as int,
@title as varchar(100),
@topic as varchar(100),
@authorId as int,
@lines as int,
@dateOfPublishing 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: 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 do I set the connection string at installation :general data provider?

Answer: The problem arises when you are using the general data providers such as classes from System.Data.OleDb and System.Data.Odbc namespaces. You can?t make a general GUI to generate the connection string for all the database servers. Then what to do now? The solution is the DataLink Dialog. You must have seen the dialog which looks like this in many windows applications:

http://www.programmersheaven.com/articles/images/faq/image014.gif

So how you can use this dialog in your program? Fo Source: CoolInterview.com

Previous 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.53125 Seconds