Arraylist and Sql Statement

  • Thread starter Thread starter kieran
  • Start date Start date
K

kieran

Hi,

I have an Arraylist with an undefined number of integers in it.

I need to place each of these in a certain sql statement and run it. I
then need to store only those integers that return results in a new
array.

In the below code I place each integer of the arraylist into the sql
statement. But I am unsure from here.

I am looking for an efficient way to check each statement. If I place
each sql statement in a string and separate them by a ';'. Can I run
this and tell which statements return results?

Any help greatly appreciated.



''''''''''''''''''''''''''

Dim i As Integer
Dim strSql1 As String
For i = 0 To al.Count - 1
strSql1 += "SELECT attribute_id FROM value WHERE val_from >= '" &
al.Item(i) & "';"
Next
Response.Write(strSql1)
 
Once you have built the SQL query string, you would use ADO.Net to
execute the query to get back, for example, a datareader. With that,
you can get the output from the query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top