What are the steps in connecting to database ?
Answer Posted / 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 |
Post New Answer View All Answers
What is the use of Dataview?
What is the current version of entity framework?
List the 4 common ado.net namespaces?
How do you update database through dataset?
What is ole2 format?
What is connection string?
What is the use of SqlCommand object?
What is the procedure to call a Stored Procedure of Back End in ADO (ActiveX Data Object) and RDO (Remote Data Objects)?
What is the difference between Dataset. clone and Dataset.copy?
What are the different layers of ado.net?
What is ado code?
What are the parameters that control most of connection pooling behaviours?
Which architecture does Datasets follow?
What is the difference between Datareader and Dataset?
Is it possible to edit data in Repeater control?