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
Give an example of a .net application which connects to microsoft access database using ado.net classes.
What is ado code?
Explain the advantage of ADO.Net?
What is the difference between ado.net and entity framework?
The answers which posted above is not satisfied my requirement? Can some one post teh exact answer? Thanx
What is the use of adodc?
What is sqldatareader?
What is the difference between Datareader and Dataset?
What is ado.net objects?
What is meant by ‘transaction’ in a database and what are the ‘properties of transaction’?
How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?
Which object is used to add relationship between two Datatables?
What is ambient transaction?
Describe datareader object of ado.net with example.
What is partial class?