用Visual Studio写了个简单的窗体应用,连接SQL server,结果报错:用户sa登录失败。
已经检查了服务器属性正确,是SQL server 和 Windows 身份模式验证
,但还是不能登录……
我的代码如下:
string ConnectionString = @"Data Source=服务器名称;Initial Catalog=要连接的数据库名称;user id=数据库登录用户名;pwd=用户密码" + "Integrated Security=True";
我的解决方法:
删掉 "Integrated Security=True
这句,就可以连接成功了。