What are the steps in connecting to database ?
Answer Posted / kalirajan
// Declare Namespace as ur Lang...
In c#
Using System.Data.SqlClient;
//connection
SqlConnection con = new
SqlConnection("server=localhost;database=Grid_Db;uid=sa;pwd=;");
con.Open();
SqlCommand cmd = new SqlCommand("select * from Gtid_Tbl",con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
What is an orm, and why would you use one instead of plain old ado.net?
What is microsoft ado.net?
What is ole word?
What is difference between ado and other data object?
How do you update a dataset in ado.net and how do you update database through dataset?
What is the difference between the clone() and copy() methods of the dataset class?
What are the Features and disadvantages of dataset
What is difference between sqldatareader and sqldataadapter?
Which architecture does Datasets follow?
What is oledb connection?
What are all components of ADO.Net data provider?
Explain what are acid properties?
If a table contains 20000 records. In a page at each time 100 records to be displayed.
What is the purpose of using adodb?
What is row state?