且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通过 C# 连接到 MySQL 服务器

更新时间:2023-02-07 20:58:59

SqlConnection 类不是数据库连接的基类;其目的是连接到 MS SQL Server DB.你想要的是一个基本的 OleDbConnection 或 OdbcConnection;如果您的 MySql 实例支持,我会使用 OleDb.

The SqlConnection class is not the base class for a DB connection; its purpose is to connect to MS SQL Server DBs. What you want is a basic OleDbConnection or OdbcConnection; I would use OleDb if your MySql instance supports it.