Blankman Blankman - 5 months ago 7
SQL Question

Connecting to a linux server running MySQL from a windows .NET server, ADO.NET?

Can I connect to a Ubuntu server, that is running MySQL using ADO.NET or do I need a special driver?


You'll need the MySQL Connector/NET ADO.NET driver.

Once installed, it behaves almost identically to Microsoft's native System.Data.SqlClient. Instead of importing that namespace, use MySQL's:

using MySql.Data.MySqlClient;


MySqlConnection DB = new MySqlConnection("SERVER=...");

Basically, just prepend My where you'd use any of the MS SqlClient classes.