GeekInterview.com
Series: Subject: Topic:

ADO.NET Interview Questions

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

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

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"

What is partial class

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

Star Read Best Answer

Editorial / Best Answer

Answered 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: 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...

Answered by: hellodebasish on: May 22nd, 2009

The class having partial keyword and same name. One class can split into more than two parts having same name and partial keyword. In the time of object creation all partial class group together to ma...

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

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

Answered by: upramod on: Jul 20th, 2011

The DataTable is the container for rows and columns and could be considered the focal point of all disconnected data

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

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

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

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

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

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

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

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

What is meant my datarow versioning in ADO.Net. Where it is used?

Asked By: guruprasad | Asked On: May 11th, 2007

Star Read Best Answer

Editorial / Best Answer

Answered by: Lavanyaaru

Member Since Jan-2008 | Answered On : Jan 29th, 2008

There are 3 versions for each DataRow object.
1.Original
2.Current
3.Proposed

The HasVersion( ) method of the DataRow can determine whether a specific version of the row exists. If the version exists, column values for it can be retrieved using one of the three overloads of the DataRow indexer


The Original version contains the values that were loaded into the row.

The Current version contains the latest version of the data, including the changes made since the data was originally loaded. The Original version isn't available for newly created rows.

A Proposed row version is made available while the row is in edit mode and contains the changes that have been made to the row while it was in edit mode

If CancelEdit( ) , RejectChanges() methods are called, the values in the Proposed version are simply discarded

Answered by: Lavanyaaru on: Jan 29th, 2008

There are 3 versions for each DataRow object.1.Original2.Current3.ProposedThe HasVersion( ) method of the DataRow can determine whether a specific version of the row exists. If the version e...

Which one of the following objects is a high-level abstraction of the connection and command objects in ADO.Net?Datareaderdatasetdatatabledataviewdataadapter

Asked By: Pandian S | Asked On: Mar 1st, 2007

Dataadapter

Star Read Best Answer

Editorial / Best Answer

Answered by: anjali

Answered On : Mar 16th, 2007

DataAdapter

Answered by: Balajibalu on: Oct 1st, 2008

  DataAdapter

Answered by: anjali on: Mar 16th, 2007

DataAdapter

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

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

Answered by: arun_sarafmca on: May 20th, 2009

1. Dataset is Disconnected Architecture While ADO Recordset is Connected
Architecture.

2. Dataset Store Multiple Tables while Data Recordset is only one table at a
time.

First | Prev | | Next | Last Page

 

 

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Career Counselling

 Have Career Question?

 Ask Chandra

 Ask Only Career questions.

Follow us:
 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, click "Subscribe".