What are the steps in connecting to database ?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / khalid
// Declare Namespace as ur Lang...
In c#
Using System.Data.SqlClient;
//connection
//If u provide uname & passwd to ur Database then this state //is true
SqlConnection con = new
SqlConnection("server=localhost;database=urDB_Name;uid=sa;pwd=;");
//else
SqlConnection con = new
SqlConnection("server=localhost;database=urDB_Name;");
con.Open();
if(con!=null)
msgbox("Connection sucessfully Done!");
else
msgbox("Sorry!Connection sucessfully is not Done!");
Is This Answer Correct ? | 0 Yes | 1 No |
Which type of database is used while processing dynamic database?
Explain ado.net features? Benefits? Drawbacks?
What are the advantages of oledb compared with other classes?
I want to ask u that if i add radio button in ado.net form,and how radion button data insert in SQL2005 Database...
What is typed dataset ?
Explain which name space is used to get assembly details?
What providers do you use to connect to oracle database ?
what is Execute NOn Query?
29 Answers Infosys, Protech, Sars Systems, SwanSoft Technologies,
What is ado in agriculture?
What is a datareader object?
Why do we serialize data?
How do you implement locking concept for dataset?