我用的控件的GridView就能自己在数据库里面查询出来数据,但是注册页面sa就登陆失败
SqlConnection con = new SqlConnection();
//连接字符串
con.ConnectionString = "Data Source=.;Initial Catalog=ku;Persist Security Info=True;User ID=sa;Password=sa95888;";
//连接数据库
con.Open();
//生成命令对象
SqlCommand com = new SqlCommand();
哪里的错误呢?
SqlConnection con = new SqlConnection();
//连接字符串
con.ConnectionString = "Data Source=.;Initial Catalog=ku;Persist Security Info=True;User ID=sa;Password=sa95888;";
//连接数据库
con.Open();
//生成命令对象
SqlCommand com = new SqlCommand();
哪里的错误呢?
User ID=sa;Password=sa95888
完全一样吗
==>
指定服务器名或IP地址吧