se ho capito bene usi vb.net.

e da quello che ho capito non di funziona perchè non lanci il comando

Dim command As New SqlCommand
command.Connection = connection
command.CommandText = "INSERT INTO esame (Nome,Cognome,Esame1,Esame2,Esame3,Sostenuto1,Sost enuto2,Sostenuto3) values ('" + nomeTextBox.Text + "','" + TextBox1.Text + "','" + esame1TextBox.Text + "','" + esame2TextBox.Text + "','" + esame3TextBox.Text + "','" + flag + "','" + flag1 + "','" + flag2 + "')"

cmd.ExecuteNonQuery()

ciao