开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜