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
Does executenonquery return a value?
What is connection string?
What are the namespaces used in ado.net for data access?
How do you find the count of records in a dataset?
What is the difference between executequery and executenonquery?
What is ado.net object model?
What is difference in record set and dataset?
How to add an aggregate column?
How is entity framework different from ado.net?
What is executequery?
Which object is used to add relationship between two Datatables?
What is ado in agriculture?
How many major types of connection objects in ADO.NET?
What is ado.net in mvc?
Explain the advantage of ADO.Net?