SqlCommand cmd = new SqlCommand("UPDATE Sample ", myConnection);
Your command text is incomplete. What exactly you need to update? You need to use the command text something like this
SqlConnection myConnection = new SqlConnection(connectionString);
myConnection.Open();
SqlCommand cmd = new SqlCommand("UPDATE Sample set
samplecode="+yourvalue , myConnection);
cmd.CommandType = CommandType.Text;