gpt4 book ai didi

mysql - 如何从winForm输入希伯来语到mySql

转载 作者:行者123 更新时间:2023-11-29 15:45:50 25 4
gpt4 key购买 nike

当我尝试在 mySql 上插入希伯来语时,一切顺利,但是当我尝试从 winForm 输入插入希伯来语数据时,我得到“???”

我使用 winForm 与 2019 和 mySql

{
string query = "INSERT INTO customers (`name`, `adress`, `phone_number`, `cellular`, `Ownership_information`, `Identity`, `email`) VALUES ('" + tbName.Text + "','" + tbAdress.Text + "','" + tbTel.Text + "','" + tbPhone.Text + "','" + tbBalut.Text + "','" + tbPasport.Text + "','" + tbEmail.Text + "')";
MySqlConnection databaseConnection = new MySqlConnection(connectionString);
MySqlCommand commandDatabase = new MySqlCommand(query, databaseConnection);
commandDatabase.CommandTimeout = 60;

try
{
databaseConnection.Open();
MySqlDataReader myReader = commandDatabase.ExecuteReader();

MessageBox.Show("User succesfully registered");

databaseConnection.Close();
}
catch (Exception ex)
{
// Show any error message.
MessageBox.Show(ex.Message);
}
}

最佳答案

我添加了Charset=utf8;到我的连接字符串现在效果很好

关于mysql - 如何从winForm输入希伯来语到mySql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57055238/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com