VS2010中的OLE DB IN C#

编程入门 行业动态 更新时间:2024-10-10 21:29:15
本文介绍了VS2010中的OLE DB IN C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试建立这样的连接: OleDbConnection conn =新的OleDbConnection( 提供商= MySqlprov;" + "DataSource = sql112.freei.me;" + 用户ID =用户;" + 密码=密码;" + 数据库=数据库名称;" ); 但例外是: "MySqlprov"提供程序未在本地计算机上注册." 请帮助我.

I try to make a connection like this: OleDbConnection conn = new OleDbConnection( "Provider=MySqlprov;" + "DataSource=sql112.freei.me;" + "User id=user;" + "Password=pass;" + "Database=db name;" ); but the exception is: "The ''MySqlprov'' provider is not registered on the local machine." please help me.

推荐答案

此 [ ^ ]可能会有所帮助. This[^] might help.

艾哈迈达利我准备在MySQL数据库中连接时使用MySQLConnection,而不是使用OLEDBConnection. 您可以在此[链接] 中下载mysqlconnector 并使用此代码进行连接. Hi Ahmadalli i prepare to use MySQLConnection than using OLEDBConnection when connecting in MYSQL Database. You can download the mysqlconnector in this [link] and use this code to connect. string strMySQLConnection = "server=localhost;user id=UserName;Password=UserPassword;database=DatabaseName;persist security info=False" MySql.Data.MySqlClient.MySqlConnection msqlConnection msqlConnection = new MySql.Data.MySqlClient.MySqlConnection(strMySQLConnection); msqlConnection.Open();

您使用的是哪个版本的.NET Framework? 你把端口号放进去了吗? what version of .NET framework you are using? did you put the port number in like this?? string strMySQLConnection = "server=localhost:3306;user id=UserName;Password=UserPassword;

或尝试使用此连接字符串

or try this connection string

string strMySQLConnection = "server=localhost:3306;Database=database;Uid=root;Connect Timeout=30;"

这是基本的连接字符串

and this is the basic Connection string

string strMySQLConnection = "server=localhost;User Id=root;database=database"

更多推荐

VS2010中的OLE DB IN C#

本文发布于:2023-11-12 10:13:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581197.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:OLE   DB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!