title: retrieving data from Mysql table using c#
body: <p>I'm trying to write a c sharp program where I enter data to database and read data from database </p>
  
  <p>Database name is kangoojump and I have an admin table here to store id,username and password</p>
  
  <p>I created a login screen for my program and want to type in my username&amp; password and when I press the login button I want to retrieve data from the database table and compare the two and if they match give access to next form...</p>
  
  <p>here is my code</p>
  
  <pre><code>MySqlCommand SelectCommand = new MySqlCommand(" SELECT username FROM kangoojump.admin where _id=1", mcon);
  
  
  MySqlDataReader myReader;
  mcon.Open();
  myReader = SelectCommand.ExecuteReader();
  while (myReader.Read())
  {
  temp1 = myReader["username"].ToString();
  }
  </code></pre>
  
  <p>I have created a username,password,temp1,temp2 of type string in my function but</p>
  
  <p>when I try to run the program I get the error that " use of unassigned variable 'temp1' "
  what is the problem with my code? 
  Thanks</p>