Sequence to connect and retrieve data from database useig
dataset ?
Answer Posted / a.anwar sadat
public SqlConnection con = new SqlConnection("server=anwar;
uid=sa; pwd=s;database=Employee;");
public SqlCommand cmd;
public SqlDataAdapter da;
public DataSet ds;
cmd = new SqlCommand("select * from empdetails", con);
da = new SqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds, "empdetails");
foreach(DataRow dr in ds.Tables["empdetails"].Rows)
{
txtempname.Text = dr["name"].ToString();
txtdob.Text = dr["dob"].ToString();
txtstreetname.Text = dr["street"].ToString();
} // foreach
Is This Answer Correct ? | 13 Yes | 6 No |
Post New Answer View All Answers
What is data access pattern?
What is the difference between dataset and datatable?
Give an example that shows how to execute a stored procedure in ado.net?
What are the major challenges in accessing data from a database?
Which architecture does Datasets follow?
What is datatable in ado.net?
Do we use stored procedure in ADO.Net?
What is ado.net full form?
What is ado.net in vb net?
What are all the classes that are available in System.Data Namespace?
What are the parameters that control most of connection pooling behaviors?
Explain executenonquery?
What is ado data control?
What are the several execute methods of ado.net?
How is it possible to get 2 tables of data at a time by using data reader?