zoukankan      html  css  js  c++  java
  • 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>

  • 相关阅读:
    时间工具类
    BEANUTIL 对象转JSON
    BeanUtil 对象转json
    导入jsp
    导入Excel加行公式和验证
    导入Excel
    导出Excel
    时间工具类
    python 装饰器的详细理解【多次实验】
    Python 爬虫 ajax爬取马云爸爸微博内容
  • 原文地址:https://www.cnblogs.com/rogerroddick/p/2941775.html
Copyright © 2011-2022 走看看