如何在具有字符串类型列(在 SQL Server 中)的表中添加类似 "jaja@yahoo.com" 的字符串,我遇到特殊字符问题(在这种情况下为'@')。谢谢
System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(
"Data Source=BOGDAN-PC\\BOGDAN;Initial Catalog=ePlanning;Integrated Security=SSPI;Connect Timeout=10;TrustServerCertificate=True ");
string[] id_dep = ddDepartament.SelectedItem.Text.Split('.');
con.Open();
string final = tbemailangajat.Text.
string sqlstring = " Update angajati set nume='" + tbNumeangajat.Text + "' ,prenume= '" + tbPrenumeangajat.Text + "',email= '" + final + "',telefon= '" + tbTelefonAngajat.Text + "',id_functie= " + ddFunctieAngajat.SelectedItem.Text[0].ToString() + ",id_departament= " + ddDepartament.SelectedItem.Text[0].ToString() + " where id_angajat = " + int.Parse(tbID.Text) + ";";
System.Data.SqlClient.SqlCommand comm = new System.Data.SqlClient.SqlCommand(sqlstring, con);
// System.Data.SqlClient.SqlDataReader reader;
comm.ExecuteNonQuery();
con.Close();