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 DataRowCollection?
Why edit is not possible in repeater?
What are the Features of a dataset
What is ole used for?
What is sqlconnection and sqlcommand?
What is row state?
What are the usages of the command object in ado.net?
Can we do database operations without using any of the ado.net objects?
What are basic methods of dataadapter?
What is ado.net object model?
What is ole in vb?
What is ole2 format?
How to pass multiple tables in datasets simultaneously?
What is ado.net code?
Explain how to create dynamic gridview?