Filling a DROPDOWN box
Could someone please review my code and tell me why i keep getting an error whilst trying to fill the DROPDOWN box?
Thanks.
Could someone please review my code and tell me why i keep getting an error whilst trying to fill the DROPDOWN box?
Thanks.
Visual Basic:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim MyConnection As String = "Host=grppc03;Database=bobbert::mv2;User Id=magic;PWD=password;"
Dim IngresConnection As New IngresConnection(MyConnection)
IngresConnection.Open()
Dim CmdString As String = "SELECT * FROM adjust_stock_t"
Dim IngresCommand As New IngresCommand(CmdString, IngresConnection)
Dim dr As IngresDataReader
dr = IngresCommand.ExecuteReader(CommandBehavior.CloseConnection)
'ddstore is the dropdown box
ddStore.DataSource = dr 'Error at this line!
ddStore.DataBind()
End Sub
Last edited: