我试图更新我的表,但出现了这样的异常:“格式不正确”(英文,“输入字符串格式不正确”)。数字?
public cordonnes(String tel, String adresse, String password)
{
InitializeComponent();
textBox1.Text = tel;
textBox2.Text = adresse;
textBox3.Text = password;
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "")
MessageBox.Show("SVP Veuillez remplir tous les champs ");
else
{
SqlConnection con = new SqlConnection(connectString);
con.Open();
int text2 = System.Convert.ToInt32(textBox2.Text);
string cmdString = "update inscrit set adresse ='" + textBox1.Text + "',tel='" + text2 + "' , password ='" + textBox3.Text + "'";
SqlCommand cmd = new SqlCommand(cmdString, con);