About ado.net components/objects. Usage of data adapters and
tell the steps to retrieve data ?

Answer Posted / kalirajan

ADO.NET Obj:

SqlConnection
SQlcommand
SqlDataReader
SqlDataAdapter
Dataset


Retrieving Data:

SqlConnection con = new SqlConnection("");
con.Open();
SqlCommand cmd = new SqlCommand("select * from Tbl", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we load multiple tables in a dataset?

554


What is a control toolbox?

509


What is ole in excel?

526


What is the difference between DataReader and DataSet in ADO.NET?

596


How is entity framework different from ado.net?

494






Which is the feature of ado.net?

532


What is the difference between the clone() and copy() methods of the dataset class?

554


How to read data with the sqldatareader ?

546


What do you mean by performing asynchronous operation using command object?

519


What is an ADO.Net?

574


How to identify the controls which can be used for binding data?

557


How can I retrieve two tables of data at a time by using data reader?

524


Name which operations can you not perform on an ado.net dataset?

494


What are the important features of ado.net 2.0?

605


What is shadow copy?

588