public List<List<string>> ColValues(string _tblName) { ConnectToMySQL dbc = new ConnectToMySQL(user_id, user_hash); List<List<string>> gd = new List<List<string>>(); string query = "SELECT * FROM " + _tblName + ";"; string countq = "SELECT COUNT(*) FROM " + _tblName + ";"; int count = dbc.Count(countq); List<string> IDs = dbc.Select("SELECT id FROM " + _tblName + ";"); for (int i = 0; i < count; i++) { List<string> gd1 = dbc.Select("SELECT * FROM "+_tblName+" WHERE id = " + IDs[i].ToString() + ";"); gd.Add(gd1); } return gd; }
//Get Column Names from specified table public List<string> ColNames(string _tblName) { ConnectToMySQL dbc = new ConnectToMySQL(user_id, user_hash); string query = "SELECT COLUMN_NAME FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = '" + _tblName + "';"; List<string> fldNames = dbc.Select(query); return fldNames; }