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
Explain how can we load multiple tables in to dataset?
How can we perform transactions in .net?
What are the pre-requisites for connection pooling?
Which is faster entity framework or ado.net?
how to create a quiz software using 4 options to answer and how to check with answers in the database and award marks....
What is Dataset Object?
What is data view and variable view?
What is the difference between typed and untyped dataset?
What is csdl entity framework?
What is the use of Dataview?
What do you mean by performing asynchronous operation using command object?
How to add a check box or a dropdown list to a column in a datagrid?
What are the difference between readonly vs. Const?
What is row state?
What provider ado.net use by default? Explain the role of data provider in ado.net? What is the role of data provider in ado.net?