public SqlConnection GetOrCreateConnection(enmdb_EXDBApplUser theDB) { try { int intDBIndex = (int)theDB; if (sqcnArr[intDBIndex] == null) { sqcnArr[intDBIndex] = new SqlConnection(DBGetConnectionStr(theDB)); sqcnArr[intDBIndex].Open(); } return(sqcnArr[intDBIndex]); } catch (Exception exc) { EXException.ThrowEXException("Πρόβλημα στην δημιουργία σύνδεσης με την Βάση Δεδομένων.\n[EX-{FD48C6FC-5193-4392-9560-08D9FB7760F6}]", exc); return(null); //never gets here } }
public SqlConnection GetOrCreateConnection(enmdb_EXDBApplUser theDB) { try { int intDBIndex = (int)theDB; if (sqcnArr[intDBIndex]==null) { sqcnArr[intDBIndex]=new SqlConnection(DBGetConnectionStr(theDB)); sqcnArr[intDBIndex].Open(); } return sqcnArr[intDBIndex]; } catch (Exception exc) { EXException.ThrowEXException("Πρόβλημα στην δημιουργία σύνδεσης με την Βάση Δεδομένων.\n[EX-{FD48C6FC-5193-4392-9560-08D9FB7760F6}]",exc); return null; //never gets here } }
public static SqlCommand DBStoredProcPrepare(enmdb_EXDBApplUser theDB, string strStoredProcName, string[] strArrParametersNames, object[] objArrParametersValues) { return DBStoredProcPrepare(Instance.GetOrCreateConnection(theDB),strStoredProcName,strArrParametersNames, objArrParametersValues); }
public static DataSet DBStoredProcExecDataSet( enmdb_EXDBApplUser theDB, string strStoredProcName, string[] strArrParametersNames, object[] objArrParametersValues) { return DBStoredProcExecDataSet(Instance.GetOrCreateConnection(theDB),strStoredProcName,strArrParametersNames,objArrParametersValues); }
public static string DBGetConnectionStr(enmdb_EXDBApplUser theDB) { //dummy return string.Empty; }
public static DataSet DBExecuteQuery(enmdb_EXDBApplUser theDB,string strQuery) { return DBExecuteQuery(Instance.GetOrCreateConnection(theDB), strQuery); }
public static SqlCommand DBStoredProcPrepare(enmdb_EXDBApplUser theDB, string strStoredProcName, string[] strArrParametersNames, object[] objArrParametersValues) { return(DBStoredProcPrepare(Instance.GetOrCreateConnection(theDB), strStoredProcName, strArrParametersNames, objArrParametersValues)); }
private SqlConnection[] sqcnArr = new SqlConnection[] { null, null, null, null, null }; // osa einai sto enum public static string DBGetConnectionStr(enmdb_EXDBApplUser theDB) { //dummy return(string.Empty); }
public static DataSet DBStoredProcExecDataSet(enmdb_EXDBApplUser theDB, string strStoredProcName, string[] strArrParametersNames, object[] objArrParametersValues) { return(DBStoredProcExecDataSet(Instance.GetOrCreateConnection(theDB), strStoredProcName, strArrParametersNames, objArrParametersValues)); }
public static DataSet DBExecuteQuery(enmdb_EXDBApplUser theDB, string strQuery) { return(DBExecuteQuery(Instance.GetOrCreateConnection(theDB), strQuery)); }