Ejemplo n.º 1
0
        private ComboBox createColumns()
        {
            ComboBox        columns    = new ComboBox();
            MySqlDataReader dataReader = controller.executeReader("SHOW COLUMNS FROM " + table + ";");

            while (dataReader.Read())
            {
                columns.Items.Add(dataReader.GetString("Field"));
            }
            dataReader.Close();
            return(columns);
        }
Ejemplo n.º 2
0
        private List <string> getListOfColumn(string table, string database, string column)
        {
            MySqlDataReader columns = controller.executeReader("SELECT " + column + " FROM " + table + ";");

            if (columns == null)
            {
                columns.Close();
                return(new List <string>());
            }
            List <string> list = new List <string>();

            while (columns.Read())
            {
                list.Add(columns.GetString(column));
            }
            columns.Close();
            return(list);
        }