You haven't associated your command cmd
with your SqlConnection, that is why you are getting the error.
You need to specify:
cmd.Connection = con;
in your submitdata()
method.
Since SqlCommand implements IDisposable, its better if you use it within using block like:
using (SqlCommand cmd = new SqlCommand())
{
cmd.Parameters.Clear();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "insertdata";
cmd.Connection = con;
.... your code
}