Write steps of retrieving data using ado.net ?

Answer Posted / sudheer lakkireddy

Take a gridview control in ur design
add
using system.data.sqlclient;
using.system.data;
// give a connection string to database

sqlconnection con= new sqlconnection("conn");

//in button click event write following

sqldataadapter da=new sqldataadapter("select * from
(tablename)",con);
dataset ds=new dataset();
da.fill(ds,"tablename");
gridview1.datasource=ds;
gridview1.datamember="tablename";
gridview1.databind();

try out this

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain why canot we use multiple inheritance and garbage collector paralelly in .net?

774


Explain the basic use of "dataview" and explain its methods.

691


Data reader read and forward only, how is it possible to get 2 tables of data at a time?

663


Which one of the following objects is a high-level abstraction of the connection and command objects in ado.net?

804


What are the main differences between classic ado and ado.net?

721


Explain the different row versions available in table?

738


How to add a check box or a dropdown list to a column in a datagrid?

714


What is the difference between the clone() and copy() methods of the dataset class?

753


What are the difference between readonly vs. Const?

671


What is ado full form?

709


What is difference between datareader and dataadapter?

760


What do you know about ado.net's objects?

688


What is aggregating data ?

684


How to check if the Dataset has records ?

721


Define different execute methods of ADO.NET command object ?

733