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 are the different layers of ado.net?
What is ado and dao?
Compare Data Reader & Dataset in ado.net?
Explain the two fundamental objects in ado.net?
Explain the namespaces in which .net has the data functionality class.
What is ole access?
What are the advantages and disadvantages of using datalist?
What is the full form of ado.net?
What is ado.net full form?
Why is stored procedure used in ado.net?
how can implement dropdownlist in particular of dataset when try to update?
What provider ado.net use by default? Explain the role of data provider in ado.net? What is the role of data provider in ado.net?
Explain the role of data provider in ado.net?
Explain the advantages and disadvantages of using datalist?
describe the dataset object in ado.net.