• C# Using MySQL


    Configuration of MySQL on C# project.

    1. Download the assembly from MySQL binary on installing MySQL connector .NET

    2. 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 initialize

    Please 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>

  • 相关阅读:
    VS2013 调试窗口一闪而过的解决方法
    什么是文件?
    局部变量和全局变量的区别
    一个简单java程序的要素
    运行一个简单的Java程序
    Javascript 构造函数原型继承机制
    函数式编程之一等公民的函数
    弹性布局flex-兼容问题
    TypeScript中的枚举类型
    依赖注入
  • 原文地址:https://www.cnblogs.com/rogerroddick/p/2941775.html
Copyright © 2020-2023  润新知