Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Why sql Data Reader object not created

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


Please Help Members By Posting Answers For Below Questions

Explain what is datagrid with an example?

1090


how can implement dropdownlist in particular of dataset when try to update?

2774


What does datareader object do?

996


What is method to get XML and schema from Dataset? getXML() and get Schema ()

966


Explain ODP.net

993


How does ado.net work?

915


What is connected architecture in ado.net?

1055


Explain how can we load multiple tables in to dataset?

937


How can we perform transactions in .net?

1056


Can we connect two dataadapters to same data source using single connection at same time?

975


Define connection string?

1062


How is it possible to get 2 tables of data at a time by using data reader?

946


Can we do database operations without using any of the ado.net objects?

978


What is oledb driver?

930


Explain how do you connect to sql server database without using sqlclient?

1000