public List <String> GetVariableDetailed() { using (DbConnection connection = new SqlConnection(connectionString)) { connection.Open(); string sitesQ = " Select TOP 3 * from variables "; DbCommand command = connection.CreateCommand(); command.CommandText = sitesQ; DbDataReader reader = command.ExecuteReader(); List <String> samples = new List <String>(); if (reader.HasRows) { while (reader.Read()) { ; DetailedVariable variable = new DetailedVariable(); variable.VariableVocabulary = VocabularyCode; variable.VariableCode = ValueFromReader(reader, "var_id"); variable.SampleMedium = "snow"; variable.DataType = "Average"; variable.ValueType = "Field Observation"; samples.Add(variable.ToString()); } } connection.Close(); return(samples); } }
public List<String> GetVariableDetailed() { using (DbConnection connection = new SqlConnection(connectionString)) { connection.Open(); string sitesQ = " Select TOP 3 * from Variables "; DbCommand command = connection.CreateCommand(); command.CommandText = sitesQ; DbDataReader reader = command.ExecuteReader(); List<String> samples = new List<String>(); if (reader.HasRows) { while (reader.Read()) { ; DetailedVariable variable = new DetailedVariable(); variable.VariableVocabulary = VocabularyCode; variable.VariableCode = ValueFromReader(reader, "VariableCode"); variable.SampleMedium = ValueFromReader(reader, "SampleMedium"); variable.DataType = ValueFromReader(reader, "DataType"); variable.ValueType = ValueFromReader(reader, "ValueType"); samples.Add(variable.ToString()); } } connection.Close(); return samples; } }