连接到使用Visual C#远程MySQL数据库 [英] Connect to remote MySQL database with Visual C#

查看:196
本文介绍了连接到使用Visual C#远程MySQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图连接到使用Visual C#2008例preSS版远程MySQL数据库。有没有一种方法使用编辑器进行连接,或者我有code手动连接?编辑器有一个清晰和易于遵循的向导连接到Microsoft SQL Server和Access数据库,但我没有看到一个简单的方法来添加远程MySQL的数据源。我试图寻找帮助,但无法找到任何有用的东西。

I am trying to connect to a remote MySQL database using Visual C# 2008 Express Edition. Is there a way to connect using the editor, or do I have to code the connection manually? The editor has a clear and easy-to-follow wizard for connecting to Microsoft SQL Server and Access databases, but I don't see an easy way to add a remote MySQL datasource. I tried searching the help, but couldn't find anything useful.

有没有人这样做呢?或者可以在一个有用的方向指向我?

Has anyone done this using the editor? Or can point me in a useful direction?

推荐答案

您必须code连接手动连接到使用Visual C#2008例preSS版远程MySQL数据库。

You will have to code the connection manually to connect to a remote MySQL database using Visual C# 2008 Express Edition.

2008年VS防爆preSS(和VS 2005例preSS太)不允许你通过数据源对话框使用MySQL .NET提供。非防爆preSS版本允许你这样做。

VS 2008 Express (and VS 2005 Express too) doesn't allow you to use MySQL .Net Provider through the Data Source Dialog. The non-Express edition allow you to do the same.

要在VS防爆preSS使用MySQL,你将不得不包括提及MySQL的DLL文件。如果您已经安装了MySQL的净提供者,这些DLL会在C:\ Program Files文件\ MySQL的\的MySQL Connector净XXX)。或DLL文件复制到你的项目的Bin文件夹。包括DLL文件后,你可以做一个的ConnectionString连接到远程MySQL数据库。

To use MySQL in VS Express, you will have to include a reference to the MySQL DLLs. If you have installed the MySQL .Net Provider, the DLLs will be in C:\Program Files\MySQL\MySQL Connector Net x.x.x). Or copy the DLLs to the Bin folder of your project. After including the DLLs, you can make a ConnectionString to connect to the remote MySQL Database.

MySQL的.NET提供可以发现这里

The MySQL .Net Provider can be found here

有一个类似的问题被要求在线程<一href="http://stackoverflow.com/questions/396593/mysql-net-provider-5-2-does-not-show-up-in-data-source-dialog-of-vs-2008-ex$p$pss">396593这里

A similar question was asked in thread 396593 here

这篇关于连接到使用Visual C#远程MySQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆