ADO.Net interview questions for fresher/ADO.Net Interview Questions and Answers for Freshers & Experienced

What Is The Difference Between Dataset.clone And Dataset.copy?

Dataset.clone object copies structure of the dataset including schemas, relations and constraints. This will not copy data in the table.
Dataset.copy – Copies both structure and data from the table.

What Are All Components Of Ado.net Data Provider?

Following are the components of ADO.Net Data provider:
Connection object – Represents connection to the Database
Command object – Used to execute stored procedure and command on Database
ExecuteNonQuery – Executes command but doesn’t return any value
ExecuteScalar – Executes and returns single value
ExecuteReader – Executes and returns result set
DataReader – Forward and read only recordset
DataAdapter – This acts as a bridge between database and a dataset.

Which Method Is Used To Sort The Data In Ado.net?

Sort() method of GridViewControl is used to sort the data in a datatable.

What Is The Default Time Out For Sql Command.commandtimeout Property?

The default timeout of Sqlcommand. CommandTimeout property is 30 Seconds.

How Can You Add Or Remove Rows From The Datatable Object Of Dataset?

The DataRowCollection class defines the collection of rows for the DataTable object in a DataSet. The DataTable class provides the NewRow() method to add a new DataRow to DataTable. The NewRow method creates a new row, which implements the same schema as applied to the DataTable. The following are the methods provided by the DataRowCollection object:
Add() - Adds a new row to DataRowCollection.
Remove()- Removes a DataRow object from DataRowCollection.
RemoveAt() - Removes a row whose location is specified by an index number.

What Is The Use Of Dataview?

User-defined view of a table is contained in a DataView. A complete table or a small section of table depending on some criteria can be presented by an object of the DataView class. You can use this class to sort and find data within DataTable.
The DataView class has the following methods:
Find() - Finds a row in a DataView by using sort key value.
FindRows() - Uses the sort key value to match it with the columns of DataRowView objects. It returns an array of all the corresponding objects of DataRowView whose columns match with the sort key value.
AddNew() - Adds a new row to the DataView object.
Delete() - Deletes the specified row from the DataView object according to the specified index.

What Is The Difference Between The Clone() And Copy() Methods Of The Dataset Class?

The Clone() method copies only the structure of a DataSet. The copied structure includes all the relation, constraint, and DataTable schemas used by the DataSet. The Clone() method does not copy the data, which is stored in the DataSet.
The Copy() method copies the structure as well as the data stored in the DataSet.

What are all the different authentication techniques used to connect to MS SQL Server?

SQL Server should authenticate before performing any activity in the database. There are two types of authentication:

* Windows Authentication – Use authentication using Windows domain accounts only.
* SQL Server and Windows Authentication Mode – Authentication provided with the combination of both Windows and SQL Server Authentication.

Define Data view?

The data view is the illustration of data in different formats, and the users can request it. Data can be uncovered in particular sort orders or filter on the user stipulation with the help of Data view.

What do you mean by the linked server?

A linked server is used to allow SQL server to carry out commands against OLE DB data sources on distant servers.

What Are The Pre-requisites For Connection Pooling?

The prerequisites for connection pooling are as follows:

<> There must be multiple processes to share the same connection describing the same parameters and security settings.
<> The connection string must be identical.

Which provider is used to connect MS Access, Oracle, etc…?

OLEDB Provider and ODBC Provider are used to connect to MS Access and Oracle. Oracle Data Provider is also used to connect exclusively for oracle database.

What is the difference between Dataset.clone and Dataset.copy?

Dataset.clone object copies structure of the dataset including schemas, relations and constraints. This will not copy data in the table.

Dataset.copy – Copies both structure and data from the table.

What Are The Various Methods Provided By The Dataset Object To Generate Xml?

The various methods provided by the DataSet object to generate XML are:

<> ReadXml() - Reads XML document into a DataSet object.
<> GetXml() - Returns a string containing an XML document.
<> WriteXml() - Writes an XML data to disk.

How Can You Identify Whether Or Not Any Changes Are Made To The Dataset Object Since It Was Last Loaded?

The DataSet object provides the following two methods to track down the changes:
The GetChanges() method - Returns the DataSet object, which is changed since it was loaded or since the AcceptChanges() method was executed.
The HasChanges() method - Indicates if any changes occurred since the DataSet object was loaded or after a call to the AcceptChanges() method was made.
If you want to revert all changes since the DataSet object was loaded, use the RejectChanges() method.

What Is The Role Of The Dataset Object In Ado.net?

One of the major component of ADO.NET is the DataSet object, which always remains disconnected from the database and reduces the load on the database.

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.

Describe The Disconnected Architecture Of Ado.net's Data Access Model?

ADO.NET maintains a disconnected database access model, which means, the application never remains connected constantly to the data source. Any changes and operations done on the data are saved in a local copy (dataset) that acts as a data source. Whenever, the connection to the server is re-established, these changes are sent back to the server, in which these changes are saved in the actual database or data source.

What Are The Usages Of The Command Object In Ado.net?

The following are the usages of the Command object in AD0.NET:
The Command object in AD0.NET executes a command against the database and retrieves a DataReader or DataSet object.

<> It also executes the INSERT, UPDATE, or DELETE command against the database.
<> All the command objects are derived from the DbCommand class.
<> The command object is represented by two classes: SqlCommand and OleDbCommand.
<> The Command object provides three methods to execute commands on the database:
<> The ExecuteNonQuery() method executes a Transact-SQL statement against the connection
and returns the number of rows affected.
<> The ExecuteScalar() method returns a single value from a database query.
<> The ExecuteReader() method returns a result set by using the DataReader object.

What are the differences between OLEDB and SQLClient Providers?

This is the advanced ADO.NET Interview Questions asked in an interview. The major differences between classic ADO and ADO.NET as below:

* ADO has Recordset whereas ADO.NET has DataSet

* In Recordset if we want to have more table data we need to perform inner join whereas DataSet can have multiple table data.

What you mean by Filtering of data?

Filtering of data is done when you need to display only selective records.

Given below are the two methods for filtering data:

Creating parameterized queries.
Filtering data using control of a window form.

Is it possible to edit data in Repeater control?

No, it is not possible to edit data in the Repeater control.

What is boxing and unboxing?

Conversion of value type to reference type is called Boxing and Conversion of reference to value type is called Unboxing. Boxing and Unboxing are used for type casting from value to reference type and vice versa.

What is the difference between Response.Expires and Reponse.ExpiresAbsolute?

Response.expires property specify the minutes of page in cache from the time, the request has been served from server.

But Response.ExpiresAbsolute property provides exact time at which the page in cache expires.

Example –

Response.expires – Set to 10 mins and it will stay in cache for 10 mins from time it has been requested

Response.ExpiresAbsolute – Oct 30 12:20:15. Till this specified time, Page will be in cache.

What is the use of connection object?

ADO.Net Connection object is used to establish a connection between application and the data source. SQL Commands can be executed once this connection has been established. It is mandatory to close the connection object once data base activities are completed.

What is the SqlCommandBuilder?

CommandBuilder helps you to generate update, delete, and insert commands on a single database table for a data adapter. Similar to other objects, each data provider has a command builder class. The OleDbCommandBuilder, SqlCommonBuilder, and OdbcCommandBuilder classes represent the CommonBuilder object in the OleDb, Sql, and ODBC data providers.

What is SqlCommand object?

The SqlCommand carries the SQL statement that needs to be executed on the database. SqlCommand carries the command in the CommandText property and this property will be used when the SqlCommand calls any of its execute methods.

The Command Object uses the connection object to execute SQL queries.
The queries can be in the form of Inline text, Stored Procedures or direct Table access.
An important feature of Command object is that it can be used to execute queries and Stored Procedures with Parameters.
If a select query is issued, the result set it returns is usually stored in either a DataSet or a DataReader object.
The three important methods exposed by the SqlCommand object is shown below:

ExecuteScalar
ExecuteNonQuery
ExecuteReader

What Are The Various Methods Provided By The Dataset Object To Generate Xml?

The various methods provided by the DataSet object to generate XML are:

* ReadXml() - Reads XML document into a DataSet object.
* GetXml() - Returns a string containing an XML document.
* WriteXml() - Writes an XML data to disk.

What is the difference between classic ADO and new ADO.NET?

This is the advanced ADO.NET Interview Questions asked in an interview. The major differences between classic ADO and ADO.NET as below:

1. ADO has Recordset whereas ADO.NET has DataSet.
2. In Recordset if we want to have more table data we need to perform inner join whereas DataSet can have multiple table data.

What are the important features of the ADO.NET 2.0 version?

The important features of ADO.NET 2.0 version as below:

* Batch Update: Batch update means it will update n number of rows of a table in a single call from a program.
* Data Paging: Data paging provides an easy way to read data from a given index from the database table.
* Bulk Copy Operation: It provides the facility of a bulk copy of data from one data source to another data source easily.
* Connection details: It provides details about connections like the cursor, buffer, and storage object etc. information.
* DataTable’s Load and Save methods: It is used for XML data interactions, storing, writing, and manipulating XML data based on W3C standards and it provides dataset serialization in binary using dataset removing format Property.

What are the key events of SqlConnection Class?

The two key events of SqlConnection are:

* StateChange event: This event occurred when the state of the Connection changes. The event handler receives an argument (Datatype: StateChangeEventArgs) which contains the data related to that particular event.

* InfoMessage event: This event occurred when an info message or Warning is returned from a data source. The event handler receives an argument (Datatype: SqlInfoMessageEventArgs) which contains the data related to that particular event.

Describe the ADO.NET object model in detail.

ADO.net is based on an Object Model. The data from Datasource is retrieved with Data Provider. The Data providers include components such as connection, DataAdapter, DataReader, and Command. It provides data to the application, updates the database with the changes made in the application.

An application can access the data either through a data set or through a DataReader object.

ADO.net also enables to create an XML representation of a dataset. In an XML representation of a dataset, data is written in XML format.

What is DataAdapter?

DataAdapter helps in linking the database and connection object. DataAdapter provides the communication between Dataset and data sources.

Data moves ‘in and out’ of the Dataset through DataAdapter.

What are the different methods by which we can populate a Dataset?

We can populate the Dataset using different the approaches mentioned below:

1. Using DataAdapter objects and the ‘fill’ method.
2. Programmatically creating Datatable, Datarow, and Data column objects.
3. Data from XML Documents.
4. Merging with another Dataset.

What do you understand by DataRelation class?

The DataRelation is a class of disconnected architecture in the .NET framework. It is found in the System.Data namespace. It represents a relationship between database tables and correlates tables on the basis of matching column.

What are the ADO.NET components?

ADO.NET components categorized in three modes:

* disconnected,
* common or shared and
* the .NET data providers.

The disconnected components build the basic ADO.NET architecture. You can use these components (or classes) with or without data providers. For example, you can use a DataTable object with or without providers and shared or common components are the base classes for data providers. Shared or common components are the base classes for data providers and shared by all data providers. The data provider components are specifically designed to work with different kinds of data sources. For example, ODBC data providers work with ODBC data sources and OleDb data providers work with OLE-DB data sources.

What Is A Datareader Object?

The DataReader object helps in retrieving the data from a database in a forward-only, read-only mode. The base class for all the DataReader objects is the DbDataReader class.
The DataReader object is returned as a result of calling the ExecuteReader() method of the Command object. The DataReader object enables faster retrieval of data from databases and enhances the performance of .NET applications by providing rapid data access speed. However, it is less preferred as compared to the DataAdapter object because the DataReader object needs an Open connection till it completes reading all the rows of the specified table.
An Open connection to read data from large tables consumes most of the system resources. When multiple client applications simultaneously access a database by using the DataReader object, the performance of data retrieval and other related processes is substantially reduced. In such a case, the database might refuse connections to other .NET applications until other clients free the resources.

What Is The Role Of The Dataset Object In Ado.net?

One of the major component of ADO.NET is the DataSet object, which always remains disconnected from the database and reduces the load on the database.

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 Can We Load Multiple Tables In To Dataset?

DataSet ds=new DataSet();
SqlDataAdapter dap=new SqlDataAdapter(Select * from ,);
dap.Fill(ds,”TableOne”);
SqlDataAdapter dap1=new SqlDataAdapter(Select * from ,);
dap1.Fill(ds,”tableTwo”);

What Is The Difference Between Oledb Provider And Sqlclient?


With respect to usage, there is no difference between OLEDB Provider and SqlClient. The difference lies in their performance. SqlClient is explicitly used to connect your application to SQL server directly, OLEDB Provider is generic for various databases, such as Oracle and Access including SQL Server.Therefore, there will be an overhead which leads to performance degradation.

What does the Data Reader object do?

The Data Reader object of ADO.NET is used to offer the contact of data from a particular data source. It contains classes to successively read data from a data foundation like Oracle, MS Access, SQL Server, etc.

What Property Must Be Set And What Method Must Be Called In Your Code To Bind The Data From Some Data Source To The Repeater Control?

You must set the DataSource property and call the DataBind() method.Mention the namespace that is used to include .NET Data Provider for SQL server in .NET code.The System.Data.SqlClient namespace.

Which Properties Are Used To Bind A Datagridview Control?

The DataSource property and the DataMember property are used to bind a DataGridView control.

What Is The Meaning Of Object Pooling?

Object pooling is a concept of storing a pool (group) of objects in memory that can be reused later as needed. Whenever, a new object is required to create, an object from the pool can be allocated for this request; thereby, minimizing the object creation. A pool can also refer to a group of connections and threads. Pooling, therefore, helps in minimizing the use of system resources, improves system scalability, and performance.

What are the data providers in ADO.NET framework?

Below Data Providers are used in ADO.NET framework.

* .NET Framework Data Provider for SQL Server – A Data provider that provides access to Microsoft SQL Server 7.0 or later version and it uses the System.Data.SqlClient namespace.
* .NET Framework Data Provider for OLE DB – A Data Provider that provides access to any database exposed by using OLE DB and it uses the System.Data.OleDb namespace.
* .NET Framework Data Provider for ODBC – A Data Provider that provides access to any databases exposed by using ODBC and It uses the System.Data.Odbc namespace.
* .NET Framework Data Provider for Oracle – A Data Provider that provides access to Oracle database 8.1.7 or later versions and it uses the System.Data.OracleClient namespace.

What is LINQ?

LINQ is native query language for .NET framework and it is specially designed to support queries with the .net applications. LINQ can be connected to SQL and MS Access.

What are the namespaces used in ADO.Net to connect to a database?

Following namespaces are used to connect to Database.

The System.Data namespace.
The System.Data.OleDb namespace – A data provider used to access database such as Access, Oracle, or SQL.
The System.Data.SQLClient namespace – Used to access SQL as the data provider.

What are two important objects of ADO.Net?

There are two important objects of ADO.Net:

1. DataReader and .
2. DataSet.

What Is Ado.net?

ADO.NET is a part of the Microsoft .NET Framework. This framework provides the set of classes that deal with data communication between various layers of the software architecture and the database. It provides a continuous access to different data source types such as SQL Server versions 7, 2000, 2005. It also provides connectivity options to data sources through OLE DB and XML. Connectivity may be established with other databases like Oracle, MySQL etc. as well.
ADO.NET has the ability to separate data access mechanisms, data manipulation mechanisms and data connectivity mechanisms.
ADO.NET introduces along with it the disconnected architecture. In a disconnected architecture, data may be stored in a DataSet. It contains providers for connecting to databases, commands for execution and retrieval of results.
The classes for ADO.NET are stored in the DLL System.Data.dll.

Search
R4R Team
R4R provides ADO.Net Freshers questions and answers (ADO.Net Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,ADO.Net interview questions for fresher,ADO.Net Freshers & Experienced Interview Questions and Answers,ADO.Net Objetive choice questions and answers,ADO.Net Multiple choice questions and answers,ADO.Net objective, ADO.Net questions , ADO.Net answers,ADO.Net MCQs questions and answers Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for ADO.Net fresher interview questions ,ADO.Net Experienced interview questions,ADO.Net fresher interview questions and answers ,ADO.Net Experienced interview questions and answers,tricky ADO.Net queries for interview pdf,complex ADO.Net for practice with answers,ADO.Net for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .