连接sql server的时候提示System.Data.SqlClient.SqlException (0x80131904): 用户 'sa' 登录失败。
代码为:namespaceWindowsFormsApplication2{publicpartialclassForm1:Form{publicForm1(){Init...
代码为:
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string constr = "server=.;database=test1;uid=sa;pwd=";
SqlConnection conn=new SqlConnection(constr);
conn.Open();
if (conn.State == ConnectionState.Open)
{
label1.Text = "已经打开";
}
}
}
}
为什么啊?我的sql登陆为混合模式啊 展开
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string constr = "server=.;database=test1;uid=sa;pwd=";
SqlConnection conn=new SqlConnection(constr);
conn.Open();
if (conn.State == ConnectionState.Open)
{
label1.Text = "已经打开";
}
}
}
}
为什么啊?我的sql登陆为混合模式啊 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询