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 difference between dataset and datatable?

1177


Explain what is datagrid with an example?

1098


How does entity framework work?

922


What is a serialized object?

1022


What is ado in agriculture?

966


Which keyword is used to accept variable number of parameters?

1127


What is sql command in ado net?

959


What are the benefits of ADO.NET?

1121


What is command class in ado.net?

1028


What is difference between Dataview and Datatable?

1069


What are the Features and disadvantages of dataset

1122


What is namespace in ado.net?

1021


Explain the advantage of ADO.Net?

990


What is disconnected scenario in entity framework?

1115


What is data view and variable view?

919