当我在文本框中插入时,阿拉伯语字符保存为????
我不知道为什么,这是源代码
我必须将textbox2.text
和textbox3.text
保存为阿拉伯字符
private void button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@"Data Source=WIN-6Q836P8JQ1C\oby;Initial Catalog=Etudiant;Integrated Security=True");
string query = "insert into etudiant(CIN, ID_NV, ID_SEC, Nom, Prenom, ID_CLA, Date_Naissance, Num_Tel, Email) values('" + textBox1.Text + "','" + comboBox1.SelectedValue + "','" + comboBox2.SelectedValue + "','" + textBox2.Text + "','" + textBox3.Text + "','" + comboBox3.SelectedValue + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "');";
SqlCommand cmd = new SqlCommand(query, con);
SqlDataReader rd;
try
{
con.Open();
rd = cmd.ExecuteReader();
MessageBox.Show("OK");
while (rd.Read()) { }
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox5.Clear();
}