Have you declared your variables because can't see the declarations in the code you have given
I don't think strictly necessary I find very helpful for debugging by adding the fields you are inserting into in the query string (eg INSERT INTO employeedata (firstname,lastname) VALUES (value1, value2) )
Again for simplicity of debugging and to allow easy cutting and pasting of code, I prefer to create a separate string for the querystring rather than include the whole string in the command. I simply call it query. Eg query="INSERT INTO employeedata (firstname,lastname) VALUES (value1, value2)"
Most obvious problem to me though is the command itself and your use of "
You have written:
myCommand = New SqlCommand("Insert into Employee values('"& txt_name.Text & "')", "myConnection" )
Note the double apostrophe around myconnection. Should be
myCommand = New SqlCommand("Insert into Employee values('"& txt_name.Text & "')", myConnection )
Similarly, the other version would be:
myCommand = New SqlCommand("Insert into Employee Data values(ddl_id.SelectedItem ,'" & txt_name.Text & "','" & txt_emerno.Text & "','" & txt_contnum.Text & "','" & txt_email.Text & "','" & txt_persemail.Text & "')",myConnection)
HOpe that helps