解决方案 »

  1.   

    知道的麻烦告诉下怎么连接mysql
      

  2.   

    mysql官方网站说得很清楚:
    Connector/Net is a fully-managed ADO.NET driver for MySQL.
    Starting with version 6.7, Connector/Net will no longer include the MySQL for Visual Studio integration. That functionality is now available in a separate product called MySQL for Visual Studio available using the MySQL Installer for Windows (see http://dev.mysql.com/tech-resources/articles/mysql-installer-for-windows.html).使用Connector/Net 6.6.6版本测试通过!或根据官网说明,下载mysql-connector-net-6.8.3-noinstall.zip。
     Select Platform… .NET & Mono 再下载。 
      

  3.   

    public string jk430_chehao(string chexing) {
                string MySqlConnection = ConfigurationManager.AppSettings["jk430DBConnectionString"];
                MySqlConnection mConnection = new MySqlConnection(MySqlConnection);
                mConnection.Open();
                sql = "select TrainCode from datainfo where TrainType='" + chexing + "' group by TrainCode";
                MySqlDataAdapter SqlAda = new MySqlDataAdapter(sql, mConnection);
                SqlAda.SelectCommand = new MySqlCommand();
                SqlAda.SelectCommand.Connection = mConnection;
                SqlAda.SelectCommand.CommandText = sql;
                SqlAda.Fill(ds, "Dzb_jk430");
                Dt = ds.Tables[0];
                mConnection.Close();
                return db.DataTable2Json(Dt, 10);
            }jk430DBConnectionString是webConfig中配置的连接字符串
      

  4.   

    和sql server大同小异啊,引用mysql的dll,使用里面的类就搞定的了。
      

  5.   

    1.安装mysql-connector-net
    2.引用组件MySQL.Data.dll
    3.然后MySqlConnection,MySqlConnectionString。。这些看行去都眼熟吧。:)