Sequence to connect and retrieve data from database useig
dataset ?
Answer Posted / ramakrushna
SqlConnection con = new SqlConnection();
con.ConnectionString = "server=munapc;
database=project1; User ID=sa; Password=niit";
con.Open();
string query = "select * from emp";
SqlDataAdapter da = new SqlDataAdapter(query, con);
SqlCommandBuilder cmd = new SqlCommandBuilder(da);
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
con.Close();
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is ado oledb and odbc?
What are the types of databinding?
What is Data Provider?
What is the full form of ado?
What are the usages of the command object in ado.net?
What are all components of ADO.Net data provider?
What is the difference between ado.net and entity framework?
What does sqldatareader return?
How to read data with the sqldatareader ?
What is aggregate root?
What is the difference between ado.net and oledb?
What are all features of ADO.Net?
Define atomicity?
What is difference between entity framework and ado.net?
What is the use of ADO.NET and XML web services?