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
How can we add/remove row's in "datatable" object of "dataset"?
What do you know about ADO.NET's objects and methods?
What is connection string?
Can we do database operations without using any of the ado.net objects?
Explain how to bind the controls(best practice) comboboxes to the data in the dataset?
Is entity framework better than ado.net?
What is Data view?
What is the functionality of data provider in ado.net?
What is execute reader in ado.net?
Why do we use sqldataadapter?
What is the difference between dataset and datatable?
Which is better ole db or odbc?
What is a non query?
Explain the overview of ado.net architecture?
Why ca not we use multiple inheritance and garbage collector paralelly in .net?