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
How can we save all data from dataset?
What is the difference in record set and dataset?
What is the use of Dataview?
Describe briefly an ADO.NET Dataset ?
What is basic use of data view?
What is DataRowCollection?
What are three methods for displaying data in a syncfusion datagrid
What is data relation?
What is the use of connection object in ado.net?
Explian About DataAdapters
What are two important objects of ADO.Net?
What is ado or jdbc?
What are the namespaces used in ado.net for data access?
What is connection in ado.net?
Which is the best method to get two values from the database?