That's some odd code - there are a lot of things wrong there, not the least being that you show an "Inserted correctly!" message before you even try to do the INSERT
Then when you do the insert, you follow it with a ExecuteReader - and discard the results you won't get anyway!
com.Parameters.AddWithValue("@Gender", Gender);
com.Parameters.AddWithValue("@ContactNumber", textBox4.Text);
com.ExecuteNonQuery();
com.ExecuteReader();
com.Dispose();
But the problem you have noticed is probably simple: the connection you thought you created, you throw away almost immediately:
using (SqlConnection con = new SqlConnection(constr))
con.ConnectionString = constr;
because that is what
using
does: disposes of the object at the end of the using block.
So ... if you are inserting data, it's not exactly obvious what you are inserting it too ...