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 are two important objects of ADO.Net?
What are the different row versions available in table?
What is DataRowCollection?
What is ado or jdbc?
What are different layers of ADO.Net?
How to bind the controls(best practice) comboboxes to the data in the dataset?
Describe the command object and its method.
Explain all the classes those are used for database connections between sql server and asp.net?
What is the provider being used to access oracle database?
How will you differentiate between ADO (ActiveX Data Object) and RDO (Remote Data Objects)?
Explain the difference in record set and dataset?
What are the core objects of ADO.NET?
What is the difference in record set and dataset?
How to copy the contents from one table to another table and how to delete the source table in ado.net?
What is ole word?