Results 1 to 7 of 7

Thread: drop down

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    drop down

    running
    cboTerm.Items.Add(oDR.Item("Term"))
    produces the error: System.IndexOutOfRangeException

    ps. the field Term is an Integer field in sql server 2000.

    any ideas please?
    Thanks

  2. #2
    Addicted Member PeteD's Avatar
    Join Date
    Jun 2003
    Location
    Sydney
    Posts
    158
    This would happen if oDR.Item("Term") does not exist

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    drop down

    Hi,
    yes, it does exist because this is the query that I am using...
    thanks

    SELECT
    DISTINCT(Term)
    FROM
    CDS_CurveSpreadData
    ORDER BY
    Term

  4. #4
    Addicted Member PeteD's Avatar
    Join Date
    Jun 2003
    Location
    Sydney
    Posts
    158

    Re: drop down

    So if you use:

    If Not oDR.Item("Term") Is Nothing Then
    cboTerm.Items.Add(oDR.Item("Term"))
    End If

    then this also fails?

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678
    yes, that fails too.
    the error again is: System.IndexOutOfRangeException

    Thanks

  6. #6
    Addicted Member PeteD's Avatar
    Join Date
    Jun 2003
    Location
    Sydney
    Posts
    158
    Are you perhaps adding the same item twice?

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678
    problem solved. thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width