Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I Create my database with sql server 2008 R2 . now when setup this software in other computers must install sql server 2008 R2 management studio ? not exist other way ?(how)

and how i set SqlConnection that run at other systems mean connect to different users dynamically . (i connect to database with data connection in visual studio)

thanks.
Posted

Firstly u have to use namespace such as using System.data.sqlclient

After that u need to take a class that name is SqlConnection after that u need to make a object of this class and pass connection parameter such as:-



SqlConnection con = new SqlConnection("Data Source=servername;Initial Catalog=databasename;User ID=ExpressSack;Password=********");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900