title: How to connect to a mysql database in C# and mimic the SELECT, UPDATE and INSERT functions
body: <p>How can I connect to a MySQL database in C#, and use it to <code>UPDATE</code> values in the database, <code>INSERT</code> values in the database and <code>SELECT</code> values from the database.</p>
  
  <p>Also, is it possible to get the value of the row, and mimic this PHP in C#?</p>
  
  <pre><code>$query = mysql_query("SELECT * FROM foo WHERE foo = 'foo');
  while($row = mysql_fetch_assoc($query)) {
  $foo1 = $row['foo1'];
  //and so on
  }
  </code></pre>