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开发者_StackOverflow 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.
You use Connector/NET.
精彩评论