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 are all the commands used with Data Adapter?
What is basic use of data view?
Which database is the ado.net?
List all the steps in order, to access a database through ado.net?
What is ole2 format?
Which namespaces are used for data access?
What is ado or jdbc?
Explain how do you connect to sql server database without using sqlclient?
What is the full form of ado?
What are the different row versions available in table?
How to creating a SqlCommand Object?
What are the data access namespaces in .NET?
How to maintain the relation between two tables in ADO.NET?
Explain About ado.net components/objects. Usage of data adapters and tell the steps to retrieve data.
What is ado and rdo?