///<summary>Returns a collection of unique AtoZ folders for the array of dbnames passed in. It will not include the current AtoZ folder for this database, even if shared by another db.</summary> public static List <string> GetAtoZforDb(string[] dbNames) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { throw new ApplicationException("MiscData.GetAtoZforDb failed. Updates not allowed from ClientWeb."); } List <string> retval = new List <string>(); DataConnection dcon = null; string atozName; string atozThisDb = PrefC.GetString(PrefName.DocPath); for (int i = 0; i < dbNames.Length; i++) { try { dcon = new DataConnection(dbNames[i]); string command = "SELECT ValueString FROM preference WHERE PrefName='DocPath'"; atozName = dcon.GetScalar(command); if (retval.Contains(atozName)) { continue; } if (atozName == atozThisDb) { continue; } retval.Add(atozName); } catch { //don't add it to the list } } return(retval); }
///<summary>Returns a collection of unique AtoZ folders for the array of dbnames passed in. It will not include the current AtoZ folder for this database, even if shared by another db.</summary> public static List<string> GetAtoZforDb(string[] dbNames) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { throw new ApplicationException("MiscData.GetAtoZforDb failed. Updates not allowed from ClientWeb."); } List<string> retval=new List<string>(); DataConnection dcon=null; string atozName; string atozThisDb=PrefC.GetString(PrefName.DocPath); for(int i=0;i<dbNames.Length;i++) { try { dcon=new DataConnection(dbNames[i]); string command="SELECT ValueString FROM preference WHERE PrefName='DocPath'"; atozName=dcon.GetScalar(command); if(retval.Contains(atozName)) { continue; } if(atozName==atozThisDb) { continue; } retval.Add(atozName); } catch { //don't add it to the list } } return retval; }
/* ///<summary>This is for multiple queries all concatenated together with ;</summary> public static DataSet GetDataSet(string commands){ DataConnection dcon=new DataConnection(); //DataTable table=dcon.GetTable(command); DataSet retVal=dcon.GetDs(commands); //retVal.Tables.Add(table); return retVal; }*/ ///<summary>Get one single value.</summary> public static string GetScalar(string command) { DataConnection dcon=new DataConnection(); return dcon.GetScalar(command); }
/* * ///<summary>This is for multiple queries all concatenated together with ;</summary> * public static DataSet GetDataSet(string commands){ * DataConnection dcon=new DataConnection(); * //DataTable table=dcon.GetTable(command); * DataSet retVal=dcon.GetDs(commands); * //retVal.Tables.Add(table); * return retVal; * }*/ ///<summary>Get one single value.</summary> public static string GetScalar(string command) { DataConnection dcon = new DataConnection(); return(dcon.GetScalar(command)); }
///<summary>Get one single value.</summary> public static string GetScalar(string command) { using (DataConnection dcon = new DataConnection()) { return(ExecuteQueryFunc(() => dcon.GetScalar(command))); } }