换了个系统之后总算搞定那个什么没注册的东东,然而数据库连接上了,也能执行,但是数据库里记录却没有增加
con.ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;";
con.ConnectionString+=@"Data Source=db_test.mdb";
con.Open();
cmd.Connection = con;
cmd.CommandText = "insert into tb_user(Name,Pass) values('" + txtUserName.Text.Trim() + "','" + txtUserPass.Text.Trim() + "')";
int k = cmd.ExecuteNonQuery();
MessageBox.Show(k.ToString());
if (k > 0)
{
MessageBox.Show("更新成功");
} |