public static void setStringValues(DAOContext con, string headerText, string strgKey, IList<string> strgs) { if (con.Connection.State != ConnectionState.Open) return; int no = 1; MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con); dao.deleteSettings(headerText, strgKey); foreach (string strg in strgs) { dao.insertNew(headerText, strgKey, no, strg); no++; } }
public static void setStringValues(string headerText, string strgKey, IList<string> strgs) { int no = 1; using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con); dao.deleteSettings(headerText, strgKey); foreach (string strg in strgs) { dao.insertNew(headerText, strgKey, no, strg); no++; } con.CloseConnection(); } }
public static void setStringValus(string headerText, string strgKey, IList<string> strgs) { int no = 1; using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con); dao.deleteSettings(headerText, strgKey); foreach (string strg in strgs) { dao.insertNew(headerText, strgKey, no, strg); no++; } con.CloseConnection(); } }