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
|
MyConnexion.Open()
Mycommand.CommandType = CommandType.Text
Mycommand.CommandText = "SELECT path FROM films WHERE nom=@nom"
'Il suffit ensuite de déclarer un magnifique paramètre SQL comme ceci :
Dim paramNom = Mycommand.CreateParameter()
paramNom.ParameterName = "@login"
paramNom.DbType = DbType.StringFixedLength
paramNom.Direction = ParameterDirection.Input
paramNom.Value = ListBox1.SelectedItem
Mycommand.Parameters.Add(paramNom)
Dim myReader As OleDbDataReader = Mycommand.ExecuteReader()
ListBox3.Items.Clear()
Do While myReader.Read()
ListBox3.Items.Add(myReader.GetString(0))
Loop
myReader.Close()
MyConnexion.Close() |