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
What is ado.net objects?
What is ado asp?
What is the procedure to call a Stored Procedure of Back End in ADO (ActiveX Data Object) and RDO (Remote Data Objects)?
Define executenonquery?
What is ado and dao?
Why do we serialize data?
How does entity framework work?
What are the features of ado.net?
Why do we use sqldataadapter?
How to connect and retrieve data from database using dataset
What are the benefits of using of ADO.NET in .NET 4.0?
What two types of data providers does ADO.NET supply? What determines which one you should use?
What is the use of adodc?
What are the differences between OLEDB and SQLClient Providers?
can we create synonymn in ms access,sql server,my sql if so explain me with example