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 to create data relations?
What Is Difference Between Ado And Ado.net?
Explain the difference in record set and dataset?
What is the difference between executequery and executenonquery?
What are three methods for displaying data in a syncfusion datagrid
What is connected architecture in ado.net?
What does ole stand for in excel?
What are two types of transaction supported by ado.net?
What are typed and untyped dataset?
What is difference in record set and dataset?
How do you connect to sql server database without using sqlclient?
Is bulk insert faster than insert?
What is the default timeout specified for "sqlcommand.commandtimeout" property?
What are the advantages of ado.net?
How many major types of connection objects in ADO.NET?