I would like to retrieve a single column of about 800 rows in a table and save these values in an array so as to reference them later on. How can I do it? I tried:
con = New OleDb.OleDbConnection("provider=SQLOLEDB;data source=PC;initial catalog=DB1;integrated security=SSPI")
cmd = New OleDbCommand("select col1 from table1", con)
con.Open()
r = cmd.ExecuteReader
While r.Read
prev_ob(i) = r.Item(0)(0)
i = i + 1
End While
For i = 0 To UBound(prev_ob)
Console.WriteLine(prev_ob(i))
Next`
And it didn't work. The col1 is of type Int64 and so is the array prev_ob(). Please let me know how I can save it to an array.