Skythrust
Member
- Jul 9, 2019
- 133
- 7
Hi there,
I am trying to make an application which is checking a number in a MySQL database. If this value is above 25 there will be a follow up action. I really can't find the solution to fix this code below.
Any advise?
I am trying to make an application which is checking a number in a MySQL database. If this value is above 25 there will be a follow up action. I really can't find the solution to fix this code below.
Any advise?
C#:
MySqlConnection conn = new MySqlConnection();
conn.ConnectionString = @"ConnString";
MySqlCommand cmd = new MySqlCommand("SELECT Value FROM Test WHERE `Name` = 'Temperature'", conn);
conn.Open();
string Value;
MySqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
Value = reader.GetString("Value");
if(Value >= "25")
{
}
MessageBox.Show(Value);