windows mysql oledb 驱动程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1393725/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:06:01 来源:igfitidea点击:
mysql oledb driver
提问by somu
how to install mysql oledb driver in local system.
如何在本地系统中安装mysql oledb驱动程序。
please give Mysql oledb Connection string
请给Mysql oledb连接字符串
回答by Lovely
Provider=OleMySql.MySqlSource.1
回答by fergal303
.NET Solution (c#)
.NET 解决方案 (c#)
You need to install MySql.Data using Package-Manager...
您需要使用包管理器安装 MySql.Data...
PM>Install-Package MySql.Data
PM>Install-Package MySql.Data
Then, in your c# code do something like this..
然后,在你的 C# 代码中做这样的事情..
using System.Data.OleDb;
using System.Data.Common;
using MySql.Data.MySqlClient;
DbProviderFactory factory = new MySqlClientFactory();
DbConnection cxn = factory.CreateConnection();
cxn.ConnectionString = "server=mysqlserver;port=3306;Database=mydb;user id=myname;password=mypass;SslMode=none;Convert Zero Datetime=True";
cxn.Open();