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
Define atomicity?
What is ado control?
How to maintain the relation between two tables in ADO.NET?
What are the rules to implement connection pooling?
Command objects uses, purposes and their methods.
How to read data with the sqldatareader ?
Explain the DataAdapter.Update() and DataSetAcceptChanges() methods.
What is ado or jdbc?
What are the advantages and disadvantages of using datalist?
How can we serialize the dataset object?
How to retrieve the user id which is provided while windows authentication?
What are the different layers of ado.net?
What is the difference between data grid and data repeater?
Explain the architecture of ado.net?
Do we use stored procedure in ADO.Net?