How can I connect to a MySQL database in C#, and use it to UPDATE values in the database, INSERT values in the database and SELECT values from the database.
Also, is it possible to get the value of the row, and mimic this PHP in C#?
$query = mysql_query("SELECT * FROM foo WHERE foo = 'foo');
while($row = mysql_fetch_assoc($query)) {
$foo1 = $row['foo1'];
//and so on
}
You have to download the MySql Connector/.NET.
How to connect to MySQL 5.0 using c# and mysql connector/net! lists some sample code which is quite similar to what you have: