C# Using MySQL
2013-05-02 23:46
357 查看
Configuration of MySQL on C# project.
1. Download the assembly from MySQL binary on installing MySQL connector .NET2. Copy it to your project’s build out directory, such as ‘$ProjectDIR/Bin/Debug’
3. Add the assembly into your solution on “Add Reference…”
4. Add ‘using MySQL.Data’ namespace in your code.
Common Error
Configuration system failed to initializePlease check syntax in the app.config. The format for using connectionstring in app.config should be like below:
<configuration> <connectionStrings> <add name="Northwind" providerName="System.Data.SqlClient" connectionString="server=(local);integrated security=SSPI;database=Northwind" /> </connectionStrings> </configuration>
Unable to find the requested .Net Framework Data Provider. It may not be installed.
MySql “找不到请求的 .Net Framework 数据提供程序。可能没有安装。”
需要在app.config或者web.config中添加下面的配置项
<system.data>
<DbProviderFactories>
<add name="MySQL Data Provider" description="ADO.Net driver for MySQL" invariant="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data"/>
</DbProviderFactories>
</system.data>
相关文章推荐
- C# Using MySQL
- 【C#】图解如何添加引用using MySql.Data.MySqlClient;
- C# Using MySQL
- 【C#】图解如何添加引用using MySql.Data.MySqlClient;
- MySQL Stored Procedure + C# Using ODBC
- C# Time Class using MySQL
- C# 代码执行MySQL脚本文件--Using MySqlScript
- Mysql : C# sample code using ObjectDataSources
- How to Connect to MySQL Using C#
- Simple FTP demo application using C#.Net 2.0
- 如何解决PHP连接MySQL时出现的Access denied for user 'root' @ 'localhost'(using password :YES)
- mysql优化(四)mysql优化索引--Using filesort
- appserv phpmyadimin登陆mysql提示1045 access denied for user 'root'@'localhost' using password yes
- mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication问题解决
- mysql——时间字段类型与C#中datetime
- mysql远程访问错误:access denied for user xxxx@xxxx(using password:YES)
- 不要忽略c#中的using和as操作符
- MySql c#通用类 转
- mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”的处理方法
- Leetcode Database using MySQL from the EASY ones 准备数据分析面试SQL试题