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

Command objects uses, purposes and their methods.

1025


What are all components of ADO.Net data provider?

1108


What is different between sqlcommand object and command behavior object?

1125


What does executequery return?

1027


What are ado.net objects?

1200


What two types of data providers does ADO.NET supply? What determines which one you should use?

1037


What are the pre-requisites for connection pooling?

1059


What is the procedure to call a Stored Procedure of Back End in ADO (ActiveX Data Object) and RDO (Remote Data Objects)?

1105


What is a string variable?

974


How to load multiple tables into a dataset?

1121


What is oledb driver?

994


How will you differentiate between ADO (ActiveX Data Object) and RDO (Remote Data Objects)?

1084


Is datareader faster than datatable?

1017


Name which operations can you not perform on an ado.net dataset?

1038


Some important instruction regarding ADO.NET connection string ?

1044