I'm trying to save the textbox values in sql table column but i got an error as ExecuteNonQuery: Connection property has not been initialized.
My code is
SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\desktop\texmas\App_Data\texsasDB.mdf;Integrated Security=True;User Instance=True");
con.Open();
SqlCommand cmd=new SqlCommand("insert into registration values('"+txt_name.Text+"','"+txt_mobile.Text+"','"+txt_email.Text+"','"+txt_qualification.Text+"','"+txt_yearofpassing.Text+"','"+FileUpload1.ToString()+"')");
cmd.ExecuteNonQuery();
con.Close();
please suggest me