homme_3d
Messages postés5Date d'inscriptionsamedi 10 juillet 2010StatutMembreDernière intervention 1 avril 2011
-
10 juil. 2010 à 17:24
Bonjour,
vb code
If (nom.Text <> "" And cin.Text <> "") Then
Dim requete As String
Dim m As String
Dim c As Integer
Dim f As String
c = cin.Text
m = nom.Text
Dim myconnection As OleDbConnection = New OleDbConnection
Dim mycommand1 As OleDbCommand = myconnection.CreateCommand
myconnection.ConnectionString = "Provider = microsoft.ACE.OLEDB.12.0; data source=" & Application.StartupPath & "\DB.accdb"
myconnection.Open()
requete = " select Nom from encadreur where CIN =" & c
mycommand1.CommandType = CommandType.Text
mycommand1.CommandText = requete
mycommand1.Connection = myconnection
mycommand1.ExecuteScalar()
Dim myreader As OleDb.OleDbDataReader = mycommand1.ExecuteReader()
*** f = myreader.GetValue(0)****
MsgBox(f)
If (m = f) Then
encadreur.ShowDialog()
Else
MsgBox("erreur")
End If
Else
MsgBox("vous devez saisir votre nom et cin")
End If
la requette elle ou la faute je veux recuperé le nom assosie a une cin qu'il sont introduit dans une base de donne j veus trouve la resulta de la requette sql select