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 are all the different methods under sqlcommand?
What is ado asp?
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 meant by ‘transaction’ in a database and what are the ‘properties of transaction’?
How do you update a dataset in ado.net?
What providers does Ado.net uses?
What is the DataTableCollection?
What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?
Which object of ado contains datarow datacolumn collection?
What is difference between connected and disconnected architecture in ado.net?
What are the major challenges in accessing data from a database?
What is executequery?
What is connection string?
What is the difference between ado.net and oledb?
What is different between sqlcommand object and command behavior object?