I'm kind of new to vb and I wanted to add items to a dropdownlist with datas from my database but I think I got the syntax wrong because I get the 'identifier expected' error.
Here is my code:
Dim dr As SqlDataReader
Dim myCommand = New SqlCommand("Select * from Vendeur", con)
con.Open()
dr = myCommand.ExecuteReader()
While dr.Read()
cboVendeur.Items.Add(dr['NomVendeur'].toString())
dr.NextResult()
End While
con.Close()
Does anyone know what I'm doing wrong?
dr.NextResult(). And:cboVendeur.Items.Add(dr("NomVendeur").toString())should be the right syntax. - muffi