access 的更新问题
以下是更新数据库的程序,但却不能完成更新的功能 ,问题到底出在哪里?请各位指点,谢谢!private void Button1_Click(object sender, System.EventArgs e)
{
string connString=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +Server.MapPath(@".\db1.mdb");
OleDbConnection conn=new OleDbConnection(connString);
string sql="UPDATE table1 SET AGE=11111 WHERE NO=112";
OleDbCommand cmd=new OleDbCommand(sql,conn);
conn.Open();
cmd.ExecuteReader();
conn.Close();
conn.Close();
string sql2="select * from table1";
OleDbCommand cmd2=new OleDbCommand(sql2,conn);
conn.Open();
this.DataGrid2.DataSource=cmd2.ExecuteReader();
this.DataGrid2.DataBind();
conn.Close();
}