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 data grid?
What is aggregating data ?
What is the difference between ADO and ADO.Net?
How to enable and disable connection pooling?
Define different execute methods of ADO.NET command object ?
Why is stored procedure used in ado.net?
Why edit is not possible in repeater?
What are the differences between OLEDB and SQLClient Providers?
How can we add relation between tables in a dataset?
How to identify the updated rows in a dataset?
What is acid in ado.net?
What is difference between executequery and executeupdate?
What are the Features and disadvantages of dataset
What is the procedure to call a Stored Procedure of Back End in ADO (ActiveX Data Object) and RDO (Remote Data Objects)?
If a table contains 20000 records. In a page at each time 100 records to be displayed.