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 acid in ado.net?
What is the DataTableCollection?
What is typed dataset ?
What are two important objects of ADO.Net?
What is the use of SqlCommand object?
What are the pre-requisites for connection pooling?
What is the difference between ado.net and oledb?
What is ole2 format?
What is connection string?
What is serialization and de-serialization in .net? How can we serialize the dataset object?
What is ole in vb?
What are the objects of ado.net?
What are the important features of ado.net 2.0?
can we create synonymn in ms access,sql server,my sql if so explain me with example
What does sqldatareader return?