GeekInterview.com
Series: Subject: Topic:

ADO.NET Interview Questions

Showing Questions 1 - 20 of 58 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

What is the difference between data reader and data adapter ?

Asked By: abi | Asked On: Aug 4th, 2006

Star Read Best Answer

Editorial / Best Answer

Answered by: Madhukar Singh

Answered On : Aug 11th, 2006

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.

Answered by: nikhiljain27 on: Jul 13th, 2013

Datareader- works in fast forward read only mode to fetch data from the database. It works in connected environment.
DataAdapter- Works as a bridge between the database and Ado.net and Fills the dataset. It works as a bridge to work in a disconnected environment.

Answered by: Deepak on: Feb 15th, 2013

1. A DataReader works in a connected environment, whereas DataSet works in a disconnected environment.

2. A DataSet represents an in-memory cache of data consisting of any number of inter related DataTable objects. A DataTable object represents a tabular block of in-memory data.

What is partial class

Asked By: hksjadon | Asked On: Sep 26th, 2006

Star Read Best Answer

Editorial / Best Answer

Answered by: bb.geetha

View all answers by bb.geetha

Member Since May-2008 | Answered On : Jun 12th, 2008

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.

Answered by: nikhiljain27 on: Jul 13th, 2013

Two or more different class having the same name and datatype but physically different from each other. At compile time all the partial class are complied in to one single entity(class) and all the m...

Answered by: lata negi on: Nov 4th, 2011

Partial class is a new feature added to .NET Framework 2.0. .NET 1.0 or 1.1, does not support for partial classes. It is possible to split the definition of a class or a struct, or an interface over t...

Data table in ADO.Net

Asked By: vineeta_2010 | Asked On: Jun 15th, 2011

What is data table in .Net and how it is different from table in database (sqlserver)

Answered by: nikhiljain27 on: Jul 13th, 2013

Datatable is one table collection of Rows and columns in ADO.Net. It is a member of the System.Data namespace in the .NET Framework. DataSet is also a combination of multiple DataTable. It works in Disconnected environment. You can Add/ update/ delete records in the Datatable at runtime.

Answered by: Trapti on: Sep 14th, 2011

The DataTable class is a member of the System.Data namespace within the .NET Framework class library. You can create and use a DataTable independently or as a member of a DataSet, and DataTable object...

How can we load multiple tables in to dataset?

Asked By: tallam ravikanth | Asked On: Jul 5th, 2006

Answered by: TheDentist on: Apr 23rd, 2013

I know the DataAdapter provides this functionality but I prefer to create a SQL Statement that performs the merge and creates a single DataSet. The servers are usually high powered machines so by let...

Answered by: Varung5 on: Jun 15th, 2010

You can pass multiple select statements in data adapter separated by “;”.SqlDataAdapter dataAdapter = new SqlDataAdapter(“select * from table1;select * from table2”, connection);DataSet ds = new DataSet();dataAdapter.Fill(ds);

Difference between ADO.Net data set and ADO record set

Asked By: Dhaval | Asked On: Feb 15th, 2007

Star Read Best Answer

Editorial / Best Answer

Answered by: ramakrishnag1982

View all questions by ramakrishnag1982   View all answers by ramakrishnag1982

Member Since Nov-2006 | Answered On : Aug 12th, 2007

1) A DataSet can represent an entire relational database in memory, complete with tables, relations, and views, A Recordset can not.

2) A DataSet is designed to work without any continuing connection to the original data source; Recordset maintains the contentious connection with the original data source.

3) There's no concept of cursor types in a DataSet, They are bulk loaded, while Recordset work with cursors and they are loaded on demand.

4) DataSets have no current record pointer, you can use For Each loops to move through the data. Recordsets have pointers to move through them.

Answered by: Kishore on: Jan 24th, 2013

Please need some more related information about the each topic..It is not sufficient to answer in Interviews.

Answered by: sathin on: Oct 29th, 2009

To get the data from a database and put it on a data control In ADO they used recordset In ADO.Net they used dataset Record set is a connection oriented architecture whereas dataset supports a c...

What is main difference between ADO and ADO.Net

Asked By: aru | Asked On: Nov 21st, 2005

Answered by: ponraman m on: May 5th, 2012

classic asp is a connection mode. asp.net is disconnected mode and most efficient to work with web application

asp is using recordset in a single table and asp.net is using dataset in multiple table

Answered by: DEEPIKA on: Dec 7th, 2011

ADO use only OLEDB and it is COM based technology.ADO use tabel log and user log

ADO.NET is Built-in technology.it provide Data binding link between Data source controls.

How do you update a dataset in ADO.Net and how do you update database through dataset

Asked By: sbehera02 | Asked On: Dec 14th, 2006

Answered by: brajesh gautam on: Feb 6th, 2012

In ADO.Net if you use the disconnect mode then local copy are already update but if we want to update a database type this program in visual studio sqlconncection = new sqlconection (" connection str...

Answered by: lata negi on: Nov 4th, 2011

Code
  1. SqlConnection conn = new SqlConnection("Server=__; DataBase=__; UID: __; Password: __");
  2. DataAdapter da;
  3. DataSet ds = new DataSet();
  4. da = new SqlDataAdapter("select * from employee", conn);
  5. ds = da.fill(ds);
  6. GridView.DataSource=ds;
  7. GridView.DataBind();
  8.  

Difference between SQLcommand and SQLcommandbuilder

Asked By: ateeqpasha | Asked On: Jun 3rd, 2006

Star Read Best Answer

Editorial / Best Answer

Answered by: sahu

View all questions by sahu   View all answers by sahu

Member Since Dec-2005 | Answered On : Mar 29th, 2007

Hi All,

Ans:

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.



Answered by: Lijo on: Nov 10th, 2011

SqlCommand: SqlCommand is used to execute Query involving Select, Update, Delete operation and to Execute SQL Stored procedures SqlCommandBuilder: SqlCommandBuilder provides the feature of refl...

Answered by: abhi_la2006 on: Jul 13th, 2011

Sql command use to only execute dml like update delete insert but sql command builder use the dml as well as the ddl like create database alter etc.

How do you bind columns manually in datagrid ?

Asked By: sreeneela | Asked On: Dec 19th, 2009

Answered by: lata negi on: Nov 4th, 2011

Code
  1. asp:GridView ID="GridView1" DataSourceID="SqlDataSource1" AutoGenerateColumns="False"
  2. runat="server">
  3.  
  4. <Columns>
  5. <asp:BoundField HeaderText="ID" DataField="au_id" ReadOnly="true"/>
  6.  
  7. <asp:BoundField HeaderText="Last Name" DataField="au_lname"/>
  8.  
  9. <asp:BoundField HeaderText="First Name" DataField="au_fname"/>
  10.  
  11. <asp:BoundField HeaderText="Phone" DataField="phone"/>
  12.  
  13. <asp:BoundField HeaderText="Address" DataField="address"/>
  14. </Columns>
  15.  
  16. </asp:GridView>
  17.  

Answered by: ptharak on: Nov 11th, 2010

set autogenerate columns ="false"

How do you connect to SQL server database without using SQLclient

Asked By: Padmaja | Asked On: Nov 7th, 2006

Star Read Best Answer

Editorial / Best Answer

Answered by: knreddy221

Answered On : Nov 10th, 2006

Using System.Oledb;OledbConnection con= new OledbConnection ("Provider=SQLOLEDB.1;User Id=sa;Database=Northwind");OledbCommand cmd= new OledbCommand ("select * from table1",con);oledbdatareader dr= new oledbdatareader ();dr= cmd.ExecuteReader();datagrid1.datasource=dr;datagrid1.databind();

Answered by: lata negi on: Nov 4th, 2011

We have 4 Data Providers to connect to our database: SqlClient = Used only for Sql Server database. OracleClient = Used only for Oracle database. Oledb = Used for any kind of databases either new or o...

Answered by: Kamal Kant Verma on: Dec 18th, 2006

you can connect sql using oledbname space .

How to compare the two data sets in ADO.Net ?

Asked By: chennakrishna | Asked On: Sep 20th, 2011

Answered by: AJ999 on: Sep 21st, 2011

Using Diffgram

Can we connect two datareader to same data source using single connection at same time?

Asked By: Niranjan | Asked On: Sep 15th, 2005

No, we cann't since once connection to database is opened must be closed before you reopen again .

Star Read Best Answer

Editorial / Best Answer

Answered by: Sathiyavathi

Answered On : Mar 24th, 2006

 We can do it in ADO.Net 2.0 as

   In your connection string there is an additional attribute named as MARS

and set it as true. MARS stands for Multiple Active Result Sets.

  Ex :

    string connectionString = "Data Source=MSSQL1;" +
    "Initial Catalog=AdventureWorks;Integrated Security=SSPI" +
    "MultipleActiveResultSets=True";

Answered by: rajankvns on: Sep 18th, 2011

Yes, 100% you can connect. help of-- Multiple Active Result Sets (MARS). more details with Example visit below Microsoft official website. -- http://msdn.microsoft.com/en-us/library/yf1a7f4f%28v=vs....

Answered by: Ravi on: Sep 16th, 2011

Yes, you can connect two datareader to the same datasource, but one main thing is close the first datareader before using second one then only it's possible. The point is, we can have any number of d...

What is "connection string"?What is "view"?What is "stored procedure"?What is "delegate"?

Asked By: Hanan | Asked On: Aug 16th, 2006

Answered by: rohit chittora on: Aug 20th, 2011

view : it is a mirror image or shadow of table with some modification so that only the essential information is display hidden some information from end user. Store procedure : this are group of exec...

Answered by: Praveen Chandra on: May 19th, 2011

1.Connection sting contains servername, database and credentials of db, without connection string we cannot working with a backend application2.View is similar to a table, user can modify the data in ...

What is the use of http handlers in iis?

Asked By: vaibhav Tyagi | Asked On: May 7th, 2010

Star Read Best Answer

Editorial / Best Answer

Answered by: machud

View all answers by machud

Member Since Apr-2011 | Answered On : Apr 10th, 2011

HTTP Handlers can be used to process custom requests that may not be in the standard supported format like .htm, .aspx, .asmx etc. One example will be RSS feed processing . One can write .rss  handler which can be configured in the IIS to accept and delegate the processing to the custom handler written to produce customized output. There are 3 basic steps that need to be performed to make a HTTP handler work properly .
a. Create Handler calss which implements IHttpHandler interface or IHttpAsyncHandler for Asynchrounous handler. IsReusable property and the ProcessRequest method is must be implememented in the Handler class
b. Register the handler class in the web.config file of the application or machine.config
c. Specify the mapping in IIS (Website->Properties->configuration->mappings) add new extension with executable as "C:WINDOWSMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll" ( assumes default installation)

Answered by: machud on: Apr 10th, 2011

HTTP Handlers can be used to process custom requests that may not be in the standard supported format like .htm, .aspx, .asmx etc. One example will be RSS feed processing . One can write .rss  handle...

Which method do you invoke on the dataadapter control to load your generated dataset with data?

Asked By: sreeneela | Asked On: Dec 19th, 2009

Star Read Best Answer

Editorial / Best Answer

Answered by: deepti705

View all answers by deepti705

Member Since Jan-2010 | Answered On : Jan 2nd, 2010

Fill() method is use to fill the data through DataSource in DataSet

Answered by: deepti705 on: Jan 2nd, 2010

Fill() method is use to fill the data through DataSource in DataSet

How is session dumped in asp .Net?

Asked By: sreeneela | Asked On: Dec 19th, 2009

Star Read Best Answer

Editorial / Best Answer

Answered by: yogeshlcse

View all answers by yogeshlcse

Member Since Jul-2009 | Answered On : Feb 17th, 2010

Session.Abandon()

Answered by: sridhar.para on: Apr 1st, 2010

Session.Abandon()

Answered by: yogeshlcse on: Feb 17th, 2010

Session.Abandon()

How to connect Oracle database and ms access to .Net framework?

Asked By: praneethreddyp | Asked On: Sep 30th, 2008

Star Read Best Answer

Editorial / Best Answer

Answered by: seemu123

View all questions by seemu123   View all answers by seemu123

Member Since May-2008 | Answered On : Nov 11th, 2008

If you have used OleDB you can use an OleDB connectionstring, if you have
used SQLClient, you have to change it to the OracleClient (standard in
2003).

Answered by: seemu123 on: Nov 11th, 2008

If you have used OleDB you can use an OleDB connectionstring, if you have
used SQLClient, you have to change it to the OracleClient (standard in
2003).

Database method

Asked By: lavi_rajput | Asked On: Sep 11th, 2008

If we are not returning any records from the database, which method is to be used?

Star Read Best Answer

Editorial / Best Answer

Answered by: Pendurti

View all answers by Pendurti

Member Since Sep-2008 | Answered On : Sep 11th, 2008

There is a method called Execute Non Query. This method executes the Update, Delete etc. 

This does not return any rows but will give the number of rows affected.

Answered by: karthimo on: Nov 30th, 2009

Executenonquery()

Answered by: rakesh_mwisp on: Nov 4th, 2009

ExecuteNonQuery - this method returns no data at all. It is used mainly with Inserts and Updates of tables.

Database access

Asked By: Lavanyaaru | Asked On: Feb 6th, 2008

Can we do database operations without using any of the ADO.Net objects?This was an interview question

Star Read Best Answer

Editorial / Best Answer

Answered by: amitdotchauhan

View all answers by amitdotchauhan

Member Since Jun-2010 | Answered On : Jun 15th, 2010

Yes.

1. SQLCMD is the utility which supports command line interface to perform SQL operations. Output data in xml file & do opertions!
Refer http://msdn.microsoft.com/en-us/library/ms162773.aspx

2. Alternate way to fetch data is enabling SQL server option which allows to provides data on web in XML format (IDK where it is but yes it was there in SQL 2k). Its data on http so you can read & process it just like a web service but cant perform operations.

I am sure there are other ways too! like

1. Create own database format other then SQL

2. Set up API in other application to fetch/process data in other application & set up custom components to store/process them.

Enjoy!

Answered by: abhisuch on: Sep 29th, 2010

Accessing data from a database is called as database access. We can access data from database using several techniques such as DAO RDO ADO.NET etc.
 

Answered by: amitdotchauhan on: Jun 15th, 2010

Yes.1. SQLCMD is the utility which supports command line interface to perform SQL operations. Output data in xml file & do opertions!Refer http://msdn.microsoft.com/en-us/library/ms162773.aspx2. A...

How can we retrieve the value which was selected from a combo box in a datagrid view.

Asked By: Bharath | Asked On: Aug 10th, 2007

The grid view consists of 3 columns which are combo boxes. I want the string in the 1st column.

Star Read Best Answer

Editorial / Best Answer

Answered by: veluworld

View all questions by veluworld   View all answers by veluworld

Member Since Jul-2007 | Answered On : Aug 28th, 2008

((DropDownList)GV_chart.Rows[e.RowIndex].FindControl("Dcity1"));

Here GV_Chart is the id of Grid View And DCity is the Name of the dropdown list

Answered by: veluworld on: Aug 28th, 2008

((DropDownList)GV_chart.Rows[e.RowIndex].FindControl("Dcity1"));

Here GV_Chart is the id of Grid View And DCity is the Name of the dropdown list

Answered by: amitrms on: Jul 14th, 2008

Use this for fetching the values from combo boxfor (int i = 0; i < dataGridView1.Rows.Count; i++)                &nbs...

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.