Type this code to create a sql connection :
//con is the object of SqlConnectoin_
SqlConnectoin con= new SqlConnetoin();
con.ConnectionString = "Data Source =Sqlservername ; Initial Catalog = table name; Integrated Security = True";
con.Open();
//Here Sqlserver name = your computer name
(You can see your computer name by :
right click on MyComputer --> Properties -->
Computer Name (tab) --> Change (BUtton)
//If you are connecting sql with user id and
password than remove Integrated security and type :
SqlConnectoin con= new SqlConnetoin();
con.ConnectionString = "Data Source =Sqlservername ; Initial Catalog = table name; User id = youruserid; password = yourpassrd";
con.Open();
for more help
www.dotnetask.blogspot.com
Under Construction
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Nikhil KumarPosted Apr 18, 2009, 8:49 AM
good explanation nik ...