c# 运行错误
这是原代码 private void button3_Click(object sender, EventArgs e)
{
try
{
int a=this.dataGrid1.CurrentCell.RowNumber;
string strCon="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\c#\\book.mdb";
OleDbConnection myConn=new OleDbConnection(strCon);
myConn.Open();
DataSet myDataSet = new DataSet();
string strCom = "DELETE From book where 编号 =";
strCom +=(string)myDataSet.Tables[0].Rows[a][0];
Console.WriteLine();
OleDbCommand delst=new OleDbCommand(strCom,myConn);
delst.ExecuteNonQuery();
OleDbDataAdapter myCommand=new OleDbDataAdapter("SELECT * FROM Book order by 编号",myConn);
myDataSet.Clear();
myCommand.Fill(myDataSet,"book");
this.dataGrid1.DataSource = myDataSet.Tables["book"];
myConn.Close();
}
catch(Exception x)
{MessageBox.Show("错误"+x.ToString(),"error");}
}