What is the difference between data reader and data adapter ?
Answered by: Madhukar Singh
Answered On : Aug 11th, 2006DateReader 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.
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.
Data Adapters are integral part of ADO.Net. It is simply a link b/w data reader and data. Adapters are used to exchange data between data source and dataset.
Difference between ADO.Net data set and ADO record set
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.
Please need some more related information about the each topic..It is not sufficient to answer in Interviews.
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
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
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
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...
Code
SqlConnection conn = new SqlConnection("Server=__; DataBase=__; UID: __; Password: __"); DataAdapter da; DataSet ds = new DataSet(); da = new SqlDataAdapter("select * from employee", conn); ds = da.fill(ds); GridView.DataSource=ds; GridView.DataBind();
Difference between SQLcommand and SQLcommandbuilder
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.
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...
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 ?
Code
asp:GridView ID="GridView1" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" runat="server"> <Columns> <asp:BoundField HeaderText="ID" DataField="au_id" ReadOnly="true"/> <asp:BoundField HeaderText="Last Name" DataField="au_lname"/> <asp:BoundField HeaderText="First Name" DataField="au_fname"/> <asp:BoundField HeaderText="Phone" DataField="phone"/> <asp:BoundField HeaderText="Address" DataField="address"/> </Columns> </asp:GridView>
set autogenerate columns ="false"
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.
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...
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
Answered by: knreddy221
Answered On : Nov 10th, 2006Using 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();
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...
you can connect sql using oledbname space .
How to compare the two data sets in ADO.Net ?
Using Diffgram
Can we connect two datareader to same data source using single connection at same time?
No, we cann't since once connection to database is opened must be closed before you reopen again .
Answered by: Sathiyavathi
Answered On : Mar 24th, 2006We 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";
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....
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 data table in .Net and how it is different from table in database (sqlserver)
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...
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"?
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...
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?
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)
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?
Answered by: deepti705
Member Since Jan-2010 | Answered On : Jan 2nd, 2010
Fill() method is use to fill the data through DataSource in DataSet
Fill() method is use to fill the data through DataSource in DataSet
How is session dumped in asp .Net?
Answered by: yogeshlcse
View all answers by yogeshlcse
Member Since Jul-2009 | Answered On : Feb 17th, 2010
Session.Abandon()
Session.Abandon()
Session.Abandon()
How to connect Oracle database and ms access to .Net framework?
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).
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).
If we are not returning any records from the database, which method is to be used?
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.
Executenonquery()
ExecuteNonQuery - this method returns no data at all. It is used mainly with Inserts and Updates of tables.
Can we do database operations without using any of the ADO.Net objects?This was an interview question
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!
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.
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.
The grid view consists of 3 columns which are combo boxes. I want the string in the 1st column.
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
((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
Use this for fetching the values from combo boxfor (int i = 0; i < dataGridView1.Rows.Count; i++) &nbs...
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...
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);