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 ado.net objects?

915


What is ado asp?

956


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

1008


Define executenonquery?

871


What is ado and dao?

911


Why do we serialize data?

889


How does entity framework work?

859


What are the features of ado.net?

966


Why do we use sqldataadapter?

912


How to connect and retrieve data from database using dataset

994


What are the benefits of using of ADO.NET in .NET 4.0?

1000


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

952


What is the use of adodc?

948


What are the differences between OLEDB and SQLClient Providers?

1089


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

2041