I'm trying to implement this code snippet
public List<int> Temperatura()
{
List<int> Datos = null;
string connStr = "server=localhost;user=root;database=sensores;port=3306;password=123456;";
MySqlConnection conn = new MySqlConnection(connStr);
try
{
Console.WriteLine("Connecting to MySQL...");
conn.Open();
string sql = "Select temperatura From datos where fecha between '" + Label3.Text + "' and '" + Label4.Text + "';";
MySqlCommand cmd = new MySqlCommand(sql, conn);
MySqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
Datos.Add(Convert.ToInt32(rdr[0]));
}
rdr.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
conn.Close();
Console.WriteLine("Done.");
return Datos;
but when loading the list, it skips that part and does not bring all the data, I do not know if it's the getValue or how it should attach the data