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
Which object is used to add relationship between two Datatables?
Is entity framework better than ado.net?
What are the steps you will take to improve performance?
oledbdataadpter with ms access in c#.net giving exception System.Data.OleDb.OleDbException while writing adapter.update(dataset,"tabname"); how to update the database from dataset?
How to pass multiple tables in datasets simultaneously?
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?
Which control of the BindingNavigator returns the current position within the data source?
What is the difference between ado.net and entity framework?
What is DataRowCollection?
What you mean by filtering of data?
What is data relation in ado.net?
Explain how do you connect to sql server database without using sqlclient?
How does ado.net work?
What are the several execute methods of ado.net?
Define partial class?