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
How do you merge 2 datasets into the third dataset in a simple manner?
What is dataadapter in ado.net?
Which property is used to check whether a DataReader is closed or opened?
What is a datagridview?
What are the benefits of ADO.NET?
What is variable view?
What is the executescalar method?
Which ado.net object is very fast in getting data from the database?
The answers which posted above is not satisfied my requirement? Can some one post teh exact answer? Thanx
Define the executescalar method?
What are the data access namespaces in .NET?
What is the difference between DataReader and DataSet in ADO.NET?
How can we load multiple tables in to dataset?
What are the difference between readonly vs. Const?
What is bubbled event can you please explain?