Bonjour,
ce code marche et il affiche tous les utilisateurs mais je voudrais alerter
par msgbox qu'un même pseudo ne peut s'inscrire deux fois
je voudrais ajouter une condition de ce genre
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 Dim conv As New MySqlConnection Dim result As Integer 'MySqlCommand It represents a SQL statement to execute against a MySQL Database Dim cmdv As New MySqlCommand 'Represents a set of data commands and a database connection that 'are used to fill a dataset and update a MySQL database. This class cannot be inherited. Dim dan As New MySqlDataAdapter Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click try conv.ConnectionString = ("server=192.168.1.24;user id=keunene;password=;database=activation") Try conv.Open() cmdv.Connection = conv 'in this query it does simply selecting or getting all the user found in the database. cmdv.CommandText = "Select * from users where pseudo ='" & TextBox3.Text & "' " Catch ex As Exception MsgBox(ex.Message) End Try conv.Close() dan.Dispose() filltable(dtguser) End Sub
merci d'avance
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 Dim ds As New DataSet If da.Fill(ds, "login") Then MsgBox("Ce code existe déjà dans notre base") end if
Partager