Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the use of data grid?

999


What is aggregating data ?

1027


What is the difference between ADO and ADO.Net?

1121


How to enable and disable connection pooling?

1110


Define different execute methods of ADO.NET command object ?

1169


Why is stored procedure used in ado.net?

1200


Why edit is not possible in repeater?

991


What are the differences between OLEDB and SQLClient Providers?

1243


How can we add relation between tables in a dataset?

1048


How to identify the updated rows in a dataset?

1054


What is acid in ado.net?

1105


What is difference between executequery and executeupdate?

1097


What are the Features and disadvantages of dataset

1175


What is the procedure to call a Stored Procedure of Back End in ADO (ActiveX Data Object) and RDO (Remote Data Objects)?

1109


If a table contains 20000 records. In a page at each time 100 records to be displayed.

932