打开SQL Server Management Studio Express, 右键点击服务器,选择Properties(属性),在弹出窗口中点击Security(安全)切换到安全面板, 将server authentication服务器认证从windows authentication mode(windows用户认证模式) 修改为Sql Server and Windows Authentication mode(Sql server和windows认证模式),ok。 打开security(安全性) -- logins(登录名) ,右键选中GAOMING,选择properties(属性),点击Status(状态)切换到状态面板,将Login(登录)设置为Enabled(启用)。
public static string connString =" Persist Security Info=False;Integrated Security=true;Initial Catalog=Student表.mdf;Server=127.0.0.1";我又从新修改了,还是不行,提示说该用户无法连接
去掉这个,这个表示用windows集成登陆,你指定用户名,就不能用这个。
右键点击服务器,选择Properties(属性),在弹出窗口中点击Security(安全)切换到安全面板,
将server authentication服务器认证从windows authentication mode(windows用户认证模式)
修改为Sql Server and Windows Authentication mode(Sql server和windows认证模式),ok。
打开security(安全性) -- logins(登录名) ,右键选中GAOMING,选择properties(属性),点击Status(状态)切换到状态面板,将Login(登录)设置为Enabled(启用)。
看看里面怎么写的就知道怎么用了
看你的一大堆
这样该
public static string connString = "server=.\\SQLEXPRESS;database=Student;uid=sa;pwd=ok;"
+ "providerName=System.Data.SqlClient";
用sa登录啊!