A
André Almeida Maldonado
Hey guys, I'm trying to populate a dropdownlist with this code:
cmdCommand.CommandText = "SELECT cliecodi, clienome FROM clientes"
cmdCommand.CommandType = CommandType.Text
dtrReader = cmdCommand.ExecuteReader()
If dtrReader.Read() Then
drpCoReClie.DataSource = dtrReader
drpCoReClie.DataValueField = "ClieCodi"
drpCoReClie.DataTextField = "ClieNome"
drpCoReClie.DataBind()
dtrReader.Close()
End If
But the dropdown doesn't show the first record, shows only the second to the
last record.
WHY?????
cmdCommand.CommandText = "SELECT cliecodi, clienome FROM clientes"
cmdCommand.CommandType = CommandType.Text
dtrReader = cmdCommand.ExecuteReader()
If dtrReader.Read() Then
drpCoReClie.DataSource = dtrReader
drpCoReClie.DataValueField = "ClieCodi"
drpCoReClie.DataTextField = "ClieNome"
drpCoReClie.DataBind()
dtrReader.Close()
End If
But the dropdown doesn't show the first record, shows only the second to the
last record.
WHY?????