private void GetCategories() { try { // Get the categories via a DataReader EfzCommand oCmd = new EfzCommand("SELECT CategoryID, CategoryName FROM Categories ORDER BY CategoryName", this.m_oCn); this.m_oCn.Open(); EfzDataReader oDR = oCmd.ExecuteReader(); // Clear the category list and fill it cboCategory.Items.Clear(); while (oDR.Read()) { cboCategory.Items.Add(new Category((string)oDR["CategoryName"], (int)oDR["CategoryID"])); } oDR.Close(); this.m_oCn.Close(); // Select the first category cboCategory.SelectedIndex = 0; } catch (EfzException exSql) { throw (new Exception(exSql.Message, exSql)); } catch (Exception ex) { throw (new Exception(ex.Message, ex)); } }
public string GetDatabaseName() { string db = "PUBLIC"; try { EfzConnection conn = InternalConnection; EfzCommand cmd = new EfzCommand(); cmd.CommandText = "SELECT DISTINCT SCHEMA FROM INFORMATION_SCHEMA.SYSTEM_SESSIONS"; cmd.Connection = conn; using (EfzDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { db = reader["SCHEMA"].ToString(); } reader.Close(); } } finally { //EfzConnection.ClearAllPools(); } return(db); }