title: How to read one row from mysql?
body: <p>I have profiles of users in mysql and I want to read one row (of some user) and add values to object "user"</p>
  
  <p>Here is part of my code: ( function that return user)</p>
  
  <pre><code>connection.Open();
  
  person person_1 = new person();
  
  //1. Read name
  string sql = "select name from profili where name=@name and surname=@surname";
      cmd = new MySqlCommand(sql, konekcija);
      cmd.Parameters.Add("@name", name);
     cmd.Parameters.Add("@surname", surname);
  
  MySqlDataReader reader = cmd.ExecuteReader();
  
  if (reader.Read()) {
  
    person_1.name = reader["name"].ToString();
  
  
  //2. Read surname
  string sql = "select surname from profili where name=@name and surname=@surname";
  cmd = new MySqlCommand(sql, konekcija);
  cmd.Parameters.Add("@name", name);
     cmd.Parameters.Add("@surname", surname);
      person_1.surname = reader["surname"].ToString();
  return person_1;
  </code></pre>
  
  <p>With this I only get name, surname is null ( see that in debbuger)</p>