Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can a DataReader be used as a DataSource for a GridView.
If it is so how will you handle paging.

Answer Posted / karthikeyant

some changes made in the above code

cmd.Connection = CON; //_cmd is sqlCommand and
CON is Connection
_cmd.CommandText = "select
Book_Code,ISBN,Title_Of_book from Book_Master";

SqlDataReader dr = _cmd.ExecuteReader();
DataTable dataTable = new DataTable();
dataTable.Load(dr);
dr.Close();
_cmd.Dispose();

dataGridView2.DataSource = dataTable;

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we add/remove row's in "datatable" object of "dataset"?

1024


What is meant by executenonquery?

938


What is data relation in ado.net?

1076


What does sqldatareader return?

965


How can I retrieve two tables of data at a time by using data reader? Data reader read and forward only, how is it possible to get 2 tables of data at a time?

979


What do you mean by ‘batch updates’?

1045


What is ado.net connection?

962


Why do we serialize data?

945


Which database is the ado.net sql connection object designed for?

1046


What are the drawbacks of using ado.net?

978


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

1003


What is serialization and de-serialization in .net? How can we serialize the dataset object?

968


What is full form of ado?

1065


What does ado stand for?

910


What is the difference between dataset and datatable?

1011