我在做一个系统,在数据库链接时出现链接错误
string zh = this.TbUser.Text.Trim();
string mm = this.TbPassword.Text.Trim();
SqlConnection conn = new SqlConnection("server=(local);database=database;uid=sa;pwd=;");
conn.Open();
// string cmdstr = "insert into user values('" + zh + "','" + mm + "')";
string cmdstr= "insert into dbo.user values('"+zh+ "','"+ mm + "')";
//链接数据库
MessageBox.Show(cmdstr);
SqlCommand cmd = new SqlCommand(cmdstr,conn);
cmd.ExecuteNonQuery();