回复 1# huangyoutiana 的帖子
int ddd=Convert.ToInt32(DataGrid1.Items[e.Item.ItemIndex].Cells[4].Text.ToString());
string aa="delete * from ly where id="+ddd+"";
OleDbConnection myconnection=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("zhuce.mdb"));
OleDbCommand mycommand=new OleDbCommand(aa,myconnection);
mycommand.Connection.Open();
mycommand.ExecuteNonQuery();
mycommand.Connection.Close();
OleDbConnection myconnection1=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("zhuce.mdb"));
OleDbDataAdapter myda=new OleDbDataAdapter("select * from ly order by data desc",myconnection1);
DataSet ds=new DataSet();
myda.Fill(ds,"xy");
DataGrid1.DataSource=ds.Tables["xy"];
DataGrid1.DataBind();
myconnection.Close();