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 read only and forward only in ado.net?
How does entity framework work?
How is it possible to get 2 tables of data at a time by using data reader?
Explain all the classes those are used for database connections between sql server and asp.net?
What is DataReader Object?
What is the return type of executescalar?
List the 4 common ado.net namespaces?
Can we load multiple tables in a dataset?
Why do we need ado.net?
What are the steps you will take to improve performance? Will you use dataset or datareader?
Explain the architecture of ado.net?
Explain the advantages and disadvantages of using datalist?
What are the ado.net connection pooling parameters?
What is a datareader object?
What is Serialization in .NET? what are the types of Serialization?