[RESOLVED] Fill array problem
Hello Guru's,
I need to fill an array with whole column from database table, so i have used reader to read the values from that column, but can not figure out how to put them into aray (code below doesn't work)
Code:
Dim aObject As Object
Dim i As Integer=0
Dim cmd As New SqlServerCe.SqlCeCommand(aQuery, aConnection)
Dim aReader As SqlServerCe.SqlCeDataReader
While aReader.Read()
aObject(i) = aReader("ID") ' ID is column name
i += 1
End While
If i put those values into list box then everything runs ok
Code:
While aReader.Read()
ListBox1.Items.Add(aReader("ID")) ' ID is column name
End While
Please help me with that.
Tank you in advance.