我安装了SQL Server 2005,WIN7系统。通过SQL Server Management Studio能够在里面新建数据库和表;
使用SQL Server身份验证,用户名师:sa;密码:690096;C#中连接语句:
try
{
string connstring="server=(local);database=C:\\Program Files\\Microsoft SQL Server\\MSSQL.2\\MSSQL\\Data\\实验.MDF;uid=sasa;pwd=690096";
SqlConnection dataConnection = new SqlConnection(connstring);
dataConnection.Open();
}
catch (SqlException except)
{ String str= except.Message;
MessageBox.Show(str);
}
连接不上,错误提示:
用户''登录失败。该用户与可信SQL Server连接无关联。给看一下吧
使用SQL Server身份验证,用户名师:sa;密码:690096;C#中连接语句:
try
{
string connstring="server=(local);database=C:\\Program Files\\Microsoft SQL Server\\MSSQL.2\\MSSQL\\Data\\实验.MDF;uid=sasa;pwd=690096";
SqlConnection dataConnection = new SqlConnection(connstring);
dataConnection.Open();
}
catch (SqlException except)
{ String str= except.Message;
MessageBox.Show(str);
}
连接不上,错误提示:
用户''登录失败。该用户与可信SQL Server连接无关联。给看一下吧
string connstring="server=localhost;database=实验;uid=sa;pwd=690096";