Arraylist and Sql Statement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kieran

    #1

    Arraylist and Sql Statement




    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)

  • Chris Dunaway

    #2
    Re: Arraylist and Sql Statement

    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.

    Comment

    Working...