Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click If Me.TextBox1.Text = "" Then MessageBox.Show("Veuiller inserrer l'élément à rechercher " & TextBox1.Text & " !", "Gestion des elèves", MessageBoxButtons.OK, MessageBoxIcon.Error) Me.TextBox1.Focus() Exit Sub End If SqlETF = "SELECT * FROM View_ELEVES WHERE ID_eleve = '" & TextBox1.Text & "'" CmdETF = New SqlCommand(SqlETF) DtaETF = New SqlDataAdapter(CmdETF) DtsETF = New DataSet CmdETF.Connection() = CnETF DtaETF.Fill(DtsETF, "View_ELEVES") DttETF = DtsETF.Tables("View_ELEVES") If RownumETF > DttETF.Rows.Count - 1 Then MessageBox.Show("L'élément recherché " & TextBox1.Text & " n'existe pas !", "Gestion des elèves", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Exit Sub End If End Sub
EDIT : Ajout des balises de code (la coloration syntaxique).
Explications disponibles ici :ICI Merci d'y penser dans tes prochains messages. |
If RownumETF > DttETF.Rows.Count - 1 then
If DttETF.Rows.Count < 1 then
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question