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 difference between dataset and datatable?
Explain what is datagrid with an example?
How does entity framework work?
What is a serialized object?
What is ado in agriculture?
Which keyword is used to accept variable number of parameters?
What is sql command in ado net?
What are the benefits of ADO.NET?
What is command class in ado.net?
What is difference between Dataview and Datatable?
What are the Features and disadvantages of dataset
What is namespace in ado.net?
Explain the advantage of ADO.Net?
What is disconnected scenario in entity framework?
What is data view and variable view?