private static void im(string lab, string d) { System.Data.OleDb.OleDbConnection con1 = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=D:/ASSEMBLER.mdb"); try { con1.Open(); System.Data.OleDb.OleDbCommand top = new System.Data.OleDb.OleDbCommand( "INSERT INTO SYMBOL_TABLE (" + "SYMBOLE,ADDRESS" + ") VALUES (?,?)", con1); top.Parameters.AddWithValue("?", lab); top.Parameters.AddWithValue("?", d); // top.Parameters.AddWithValue("?", mcs[2]); top.ExecuteNonQuery(); con1.Close(); Form2 obj = new Form2(); obj.grid2(); } catch (Exception ex) { // MessageBox.Show(ex.Message); } }
public static void cv(string a, string b) { try { con1.Open(); System.Data.OleDb.OleDbCommand top1 = new System.Data.OleDb.OleDbCommand("UPDATE SYMBOL_TABLE SET[ADDRESS] = ? where SYMBOLE = ?", con1); top1.Parameters.AddWithValue("?", a); top1.Parameters.AddWithValue("?", b); top1.ExecuteNonQuery(); con1.Close(); Form2 obj = new Form2(); obj.grid2(); } catch (Exception e) { // MessageBox.Show(e.Message); } }