Bjrs a tous, je voulait recuperer la valeur dans un champs dans ma base de donnee et l'afficher dans un textbox:
j'ai ces codes:
'apres la chaine de connection bien sur...
Dim str As String = "Select produit.pronom from produit where idproduit='CH'"
Dim myCommand As SqlCommand = Nothing
Dim myReader As sqlDataReader = Nothing
Try
myCommand = New SqlCommand(str, MyConnection)
MyConnection.Open()
myReader = myCommand.ExecuteReader()
If myReader.HasRows Then
While myReader.Read
TextBox1.Text = myReader.GetString(1)
End While
Else
End If
Catch ex As Exception
MsgBox(ex.ToString())
Finally
myReader.Close()
MyConnection.Close()
End Try
mais ca donne rien . Ou changer et myReader.GetString(1) que veut dire le chifre (1) car je trouver ca sur le forum en croyant que c'est l'indice du chanpa voulut mais en vain
Pouriez vous m'aider SVP??
Sengi Jonathan