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 the namespaces used in ADO.Net to connect to a database?
Which components of a data provider is used to retrieve, insert, delete, or modify data in a data source?
What is microsoft ole db provider for sql server?
Describe connection object in ado.net
How can we serialize the dataset object?
What is namespace in ado.net?
Explain the two fundamental objects in ado.net?
What is the return type of executescalar?
What are the parameters that control most of connection pooling behaviors?
What is a dynaset in access?
What are three methods for displaying data in a syncfusion datagrid
What is the difference between the clone() and copy() methods of the dataset class?
What is datasource in ado.net?
What is the use of SqlCommand object?
how you will deal result set? How do you sort a dataset?If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?