public int dictionaryUpdate(tb_dictionary tb_aut) { int intResult = 0; try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "update tb_dictionary set "; strAdd += " codName ='" + tb_aut.strcodeName + "', codeReam='" + tb_aut.strcodeReam + "' where codeID='" + tb_aut.strcodeID + "'"; oledcmd = new SqlCommand(strAdd, oledCon); intResult = oledcmd.ExecuteNonQuery(); return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }
public int dictionaryAdd(tb_dictionary tb_aut) { int intResult = 0; try { getConnection getCon = new getConnection(); // oledCon = new OleDbConnection(ConfigurationSettings.AppSettings["StrCon"].ToString()); oledCon = getCon.OledCon();; oledCon.Open(); string strAdd = "insert into tb_dictionary (codeID,codName,codeReam) values ( "; strAdd += "'" + tb_aut.strcodeID + "','" + tb_aut.strcodeName + "','" + tb_aut.strcodeReam + "')"; oledcmd = new SqlCommand(strAdd, oledCon); intResult = oledcmd.ExecuteNonQuery(); return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }