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

How to work with disconnected data - the dataset and sqldataadapter?

498


What is connection string?

521


What are the essential features of ado.net?

534


What is the functionality of data provider in ado.net?

483


What is ado.net in vb net?

496






What is DataRowCollection?

618


What are the Features of a dataset

663


What is acid in ado.net?

524


What are the disadvantages of using datalist?

499


What is connection in ado.net?

525


Which namespaces are used for data access?

613


What are the major challenges in accessing data from a database?

522


What do you mean by ‘batch updates’?

505


What is difference between ado and other data object?

462


What is difference between datatable and dataset?

517