I am uploading data to databases but my form upload the same data twice in databases first I was uploading data without checking weather is inserted or not it was working fine it was uploading the data single time now I have put the checked that if data inserted than show the message data inserted successful but this is uploading data twice.
Here is my code:
SqlConnection conn1 = new SqlConnection("Data Source=ZAZIKHAN\\SQLEXPRESS;Initial Catalog=resume;Integrated Security=True");
conn1.Open();
SqlCommand cmd3 = new SqlCommand("insert into Profile(Id,Name,JobTitle,Phone,Email,Address,Website,Facebook,Twitter,GooglePlus,Skype,Picture,WhyMeText) values('"+ID.Text+"','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','" + TextBox8.Text + "','" + TextBox9.Text + "','" + TextBox10.Text + "','" + uploadFolderPath + "','" + TextArea1.InnerText + "')", conn1);
cmd3.ExecuteNonQuery();
if (cmd3.ExecuteNonQuery() == 1)
{
Response.Write("<script LANGUAGE='JavaScript' >alert('information saved Successful')</script>");
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
TextBox6.Text = "";
TextBox7.Text = "";
TextBox8.Text = "";
TextBox9.Text = "";
TextBox10.Text = "";
TextArea1.InnerText = "";
}
else { Response.Write("<script LANGUAGE='JavaScript' >alert('sorry try again')</script>"); }
conn1.Close();