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

What is acid in ado.net?

1023


What is the DataTableCollection?

1048


What is typed dataset ?

1175


What are two important objects of ADO.Net?

1014


What is the use of SqlCommand object?

1222


What are the pre-requisites for connection pooling?

1001


What is the difference between ado.net and oledb?

940


What is ole2 format?

900


What is connection string?

998


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

962


What is ole in vb?

898


What are the objects of ado.net?

1063


What are the important features of ado.net 2.0?

1071


can we create synonymn in ms access,sql server,my sql if so explain me with example

2081


What does sqldatareader return?

958