title: How to read certain data from mysql results in C#
body: <p>I want to make certain query to mysql from C# so I can get back for example name and lastname.</p>
  
  <p>I don't know how to handle this in c# and I want to minimize sqlinjection.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>con = new MySqlConnection("server=localhost;database=Customers;uid=root;pwd=******");
  con.Open();
  cmd = new MySqlCommand("SELECT name,lastname FROM customer WHERE ID_customer= ?Parname;", con);
  cmd.Parameters.Add("?Parname", MySqlDbType.Float).Value = customer_card;
  cmd.ExecuteNonQuery();
  con.Close();
  </code></pre>
  
  <p>I want to be able for example to read results and it will be only one result, in the 2 string variables. How to get trough the data and save it?</p>
  
  <p>Thank you</p>