using System.Data;
using System.Data.SqlClient;
//混合登录模式 用户名(uid)为sa 密码(pwd)为123456; 没得密码就是 uid=sa;pwd=";
string connString = "Data Source=localhost;database=MyDatabase#1;uid=sa;pwd=123456";
//Windows登录
string connString = "Data Source=localhost;database=MyDatabasebb#1;"Trusted_Connection=SSPI"
SqlConnection conn = new SqlConnection(connString);
..
微软官网即可下载安装包,免费的