axman1000 0 Newbie Poster

I have a list of values extracted from a datareader in a list. Is it possible for me to run a query to extract another set of values using a datareader and then use the individual values in the list and the values in the datareader to perform some calculation, and possibly use the item values in a query itself?

The code snippet is as follows:

Dim prev_ob As New List(Of Int64)
.
.
.
con = New OleDb.OleDbConnection("provider=SQLOLEDB;data source=pc;initial catalog=DB1;integrated security=SSPI")
cmd = New OleDbCommand("query", con)
con.Open()
r = cmd.ExecuteReader
While r.Read
prev_ob.Add(r.Item("col1"))
End While

I will be running another query and retrieve another set of values using a datareader. How can I use the items in this list and the ones I retrieve using the datareader and perform some mathematical calculation and possibly use it in a query? Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.