C# c“winform连接到mysql”;字符集';UTF8';.Net Framework不支持;

C# c“winform连接到mysql”;字符集';UTF8';.Net Framework不支持;,c#,mysql,winforms,C#,Mysql,Winforms,我有一个winform可以在按下按钮时连接到mysql string sql = "INSERT INTO `products` (`catid`, `entity_id`, `sku`, `price`, `final_price`, `qty`, `is_in_stock`, `special_from_date`, `special_to_date`, `status`, `parent_id`) VALUES ('@catid', 1,'100',100.0000, 50.000

我有一个winform可以在按下按钮时连接到mysql

 string sql = "INSERT INTO `products` (`catid`, `entity_id`, `sku`, `price`, `final_price`, `qty`, `is_in_stock`, `special_from_date`, `special_to_date`, `status`, `parent_id`) VALUES ('@catid', 1,'100',100.0000,    50.0000,9.0000, 1,  NULL,   NULL,   NULL,   NULL);";
            if  (mproductDataGridView.SelectedRows.Count != 0)
            {

                //
                string connectionString = "datasource=127.0.0.1;port=3306;username=root;password=Abcd1234;database=pos; convert zero datetime=True;charset=UTF8";
                MySqlConnection databaseConnection = new MySqlConnection(connectionString);
                databaseConnection.Open();
                // MySqlConnection databaseConnection = dao.connect();
                MySqlCommand sqlCmd = new MySqlCommand(sql, databaseConnection);

                //sqlCmd.Parameters.Add(new MySqlParameter("@catid", "abc"));


                foreach (DataGridViewRow r in mproductDataGridView.SelectedRows)
                {
                    //{ "catid":"15","entity_id":"231","sku":"msj000","name":"French Cuff Cotton Twill Oxford","price":"190.0000","final_price":"190.0000","qty":"14.0000","is_in_stock":"1","special_from_date":null,"special_to_date":null,"status":"1","parent_id":"402"
                    string str_catid = r.Cells["catid"].Value.ToString();
                    string entity_id = r.Cells["entity_id"].Value.ToString();
                    string sku = r.Cells["sku"].Value.ToString();
                    string name = r.Cells["name"].Value.ToString();
                    string price = r.Cells["price"].Value.ToString();
                    string final_price = r.Cells["final_price"].Value.ToString();
                    string qty = r.Cells["qty"].Value.ToString();
                    string is_in_stock = r.Cells["is_in_stock"].Value.ToString();
                    string special_from_date = r.Cells["special_from_date"].Value.ToString();
                    string special_to_date = r.Cells["special_to_date"].Value.ToString();
                    string status = r.Cells["status"].Value.ToString();
                    string parent_id = r.Cells["parent_id"].Value.ToString();

                    sqlCmd.Parameters.AddWithValue("@catid", str_catid);
                    sqlCmd.ExecuteNonQuery();
                    //dao.insertCommand(sqlCmd);


                }
有一个例外是:

An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll

Additional information: Character set 'UTF8' is not supported by .Net Framework.
似乎连接字符串不能包含charset=UTF8,否则将引发异常。另一个项目也在连接字符串中使用charset=UTF8,但
没有错误,有人知道问题出在哪里吗

用小写字母尝试
CharSet=utf8
utf
O,你说得对,我不知道为什么我以前的项目可以用大写字母