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
Explain how to call the sql commands asynchronously in ado.net version 2.0?
What is sqldatareader?
Explain the DataAdapter.Update() and DataSetAcceptChanges() methods.
What are all the classes that are available in System.Data Namespace?
What is executenonquery ado.net?
Explain the different row versions available in table?
What are the Features of a dataset
Is datareader faster than datatable?
What is ole word?
What is the DataTableCollection?
How can we perform transactions in .net?
What are all components of ADO.Net data provider?
What is an example of ordinal data?
What is the role of data provider in ado.net?
Explain the namespaces in which .net has the data functionality class.