private DataSet GetSqlDataSet(string siteID, string query)
        {
            //string QUERY = createSQL(caseNumber);
            CDBBroker  broker           = new CDBBroker(siteID);
            var        brokerConnection = broker.GetConnection("Justice");
            DataSet    ret = null;
            SqlCommand cmd = new SqlCommand(string.Format(query), brokerConnection as SqlConnection);

            try
            {
                cmd.Connection.Open();
                Logger.WriteToLog("Finding Cases", LogLevel.Verbose);
                ret = CDBBroker.LoadDataSet(siteID, cmd, true);
                Logger.WriteToLog("DataSet Record Count: " + ret.Tables[0].Rows.Count, LogLevel.Verbose);
            }
            finally
            {
                if (cmd != null)
                {
                    cmd.Connection.Close();
                }
            }

            return(ret);
        }
Exemple #2
0
        private DataSet ExecuteSQL(string siteID, string query)
        {
            CDBBroker  broker           = new CDBBroker(siteID);
            var        brokerConnection = broker.GetConnection("Justice");
            DataSet    ret = null;
            SqlCommand cmd = new SqlCommand(string.Format(query), brokerConnection as SqlConnection);

            try
            {
                cmd.Connection.Open();
                ret = CDBBroker.LoadDataSet(siteID, cmd, true);
            }
            finally
            {
                if (cmd != null)
                {
                    cmd.Connection.Close();
                }
            }

            return(ret);
        }