Answer Posted / shakeer
We don't require to create object of DataReader class.
Because , For Example
if any string value is there like "Hello"
we will capture that value into String Class varible.
String s = "Hello";
In the same way when we call ExecuteReader() method, the
return type is DataReader
METHOD RETURN TYPE
ExecuteReader() ----> Datareader
DataReader: Which is having the capacity of holding the data
in the form of Rows and Columns
when we need to capture the value of string type, we
created the variable of the String class & captured it.
Similarly in the case of Datareader, we will create variable
of Datareader and capture the return type of ExecuteReader()
method.
So, DataReader dr = cmd.ExecuteReader();
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is an ADO.Net?
Explain why canot we use multiple inheritance and garbage collector paralelly in .net?
What is difference between Dataview and Datatable?
What is connection string?
What is a datagridview?
What are the benefits of using ado.net?
Explain how to find the given query is optimised one or not?
What is microsoft ado?
What are the key features of ado.net?
What is the difference between DataReader and DataSet in ADO.NET?
What is difference between connected and disconnected architecture in ado.net?
Explain how to copy the contents from one table to another table and how to delete the source table in ado.net?
What is the role of the dataset object in ado.net?
What is difference between datagridview and datagrid control in winforms?
What is ado code?