asp.net菜问题
为什么这代码运行过去后,出现登陆到数据库失败呢?各位大侠???
private void Page_Load(object sender, System.EventArgs e)
{
SqlConnection conn;
conn=new SqlConnection( "workstation id=SCOFIELD;packet size=4096;integrated security=SSPI;data source=SCOFIELD;persist security info=False;initial catalog=stu ");
conn.Open();
Label1.Text=conn.State.ToString();
conn.Close();
}
看下是SQL Server问题还是C#代码问题??
------解决方案--------------------strCon= "DataBase=*;server=*;uid=sa;pwd=; "
------解决方案--------------------conn=new SqlConnection( "server=localhost;database=SCOFIELD;uid=sa;pwd=; ")
------解决方案--------------------连接字符串问题,同楼上
服务器 server = ????
数据库 DataBase = ????
登陆用户名 uid = ????
登陆密码 pwd = ????
------解决方案--------------------这样写试试
server=(local);database=SCOFIELD;uid=sa;pwd=;