如何使用MySQL asp.net? [英] how to use mysql with asp.net?
问题描述
我想使用MySQL与我的Asp.Net应用程序,并想知道怎么办。我将使用MySQL的第一次。我想知道,最重要的是如何连接到MySQL数据库。
您可以使用下面的ConnectionString在你的web.config连接到MySQL数据库:
<&是connectionStrings GT;
<添加名称=MySQLConnStr的connectionString =DRIVER = {MySQL的ODBC驱动程序3.51};数据库= YourDatabase;服务器=本地主机; UID =您的用户名; PWD =你的密码;/>
< /&是connectionStrings GT;
您需要尝试从ASP.NET连接到MySQL数据库之前做到以下几点:
- 确保您已经安装了.NET Framework的服务器上
- 下载ODBC .NET数据提供程序和开发机器或服务器上安装它。你可以在这里下载:<一href=\"http://www.microsoft.com/downloads/details.aspx?FamilyID=6ccd8427-1017-4f33-a062-d165078e32b1&DisplayLang=en\">http://www.microsoft.com/downloads/details.aspx?FamilyID=6ccd8427-1017-4f33-a062-d165078e32b1&DisplayLang=en
- 安装MySQL ODBC驱动的MyODBC 3.51。你可以在这里下载:<一href=\"http://dev.mysql.com/downloads/connector/odbc/3.51.html\">http://dev.mysql.com/downloads/connector/odbc/3.51.html
下面将完全向你解释ODBC的体系结构:
而对于更多的细节通过下面引用的文章:
从ASP.NET 连接到MySQL数据库
使用MySQL数据库(示例应用程序)
ASP.NET应用程序> NET范例希望这有助于。
I want to use MySQL with my Asp.Net application and would like to know how. I am going to use MySQL for the first time. The most important thing I would like to know is how to connect to a MySQL database.
You can use the following connectionstring in your web.config to connect to mysql database:
<connectionStrings>
<add name="MySQLConnStr" connectionString="DRIVER={MySQL ODBC 3.51 Driver};Database=YourDatabase;Server=localhost;UID=YourUsername;PWD=YourPassword;"/>
</connectionStrings>
You need to do the following before attempting to connect from ASP.NET to MySQL database:
- Make sure you have installed the .Net Framework on your server
- Download the ODBC .Net data provider and install it on your development machine or your server. You can download it here: http://www.microsoft.com/downloads/details.aspx?FamilyID=6ccd8427-1017-4f33-a062-d165078e32b1&DisplayLang=en
- install MySQL ODBC Driver-MyODBC 3.51. You can download it here: http://dev.mysql.com/downloads/connector/odbc/3.51.html
The following will perfectly explain to you the architecture of ODBC:
And for more details go through following referenced articles:
Connect to MySQL database from ASP.NET
An ASP.NET Application Using a MySQL Database (Sample Application)
ASP.NET with MySQL - Getting started
Hope this helps.
这篇关于如何使用MySQL asp.net?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!