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 Dataview?

1112


What is the current version of entity framework?

946


List the 4 common ado.net namespaces?

1149


How do you update database through dataset?

967


What is ole2 format?

889


What is connection string?

990


What is the use of SqlCommand object?

1211


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

1036


What is the difference between Dataset. clone and Dataset.copy?

1028


What are the different layers of ado.net?

1054


What is ado code?

936


What are the parameters that control most of connection pooling behaviours?

1054


Which architecture does Datasets follow?

1023


What is the difference between Datareader and Dataset?

1068


Is it possible to edit data in Repeater control?

940