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
Which one of the objects is a high-level abstraction of the connection and command objects in ado.net?
Define executenonquery?
What is the difference between DataReader and DataSet in ADO.NET?
What is connection pooling and what is the maximum pool size in ado.net connection string?
What is connected architecture in ado.net?
What is acid in ado.net?
Describe briefly an ADO.NET Dataset ?
How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?
What is bubbled event can you please explain?
What is namespace in ado.net?
What is ado asp?
What is bubbled event?
Explain the various objects in dataset.
What are the major difference between classic ADO and ADO.NET?
What is the maximum pool size in ado.net connection string?