title: if (counter == < database value >)
body: <p>How do I make the value from my database as a int that I can use for my if else function ?</p>
  
  <p>For example: In my database "armnumber = 3", how do I use it in my if else function ?</p>
  
  <p><strong>code</strong></p>
  
  <pre><code>string myConnectionString;
  myConnectionString = "server=localhost;uid=root;pwd=root;database=medicloud;SslMode=None;charset=utf8";
  
  try
  {
      MySqlConnection connection = new MySqlConnection(myConnectionString);
      MySqlCommand cmd = new MySqlCommand();
  
      cmd.CommandType = CommandType.Text;
      string sqlStr = "Select armnumber from assign where id=1";
      cmd.CommandText = sqlStr;
      cmd.Connection = connection;
  
      connection.Open();
      cmd.ExecuteNonQuery();
  }
  
  catch (MySqlException ex)
  {
  }
  #endregion
  if (counter == )
  {
  }
  </code></pre>