连接字符串出错(索引74)

时间:2014-03-01 23:45:59

标签: c# mysql-connector

我正在尝试连接到在线mysql数据库,但我的代码失败并显示错误:

  

初始化字符串的格式不符合从索引74开始的规范

我的连接字符串如下所示:

    public DBConnect()
    {
        Initialize();
    }

    private void Initialize()
    {
        server = "111.111.111";
        database = "base";
        uid = "user";
        password = "password";
        string connectionString;
        connectionString = "Server=" + server + ";" + "Database=" + database + ";" + "Uid=" + uid + ";" + "Pwd=" + password + ";";


        connection = new MySqlConnection(connectionString);

    }

0 个答案:

没有答案