1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

My SQL Statment

Discussion in 'C#' started by danjapro, Feb 3, 2006.

  1. #1
    This is my SQL Query, but I get the error message

    Item cannot be found in the collection corresponding to the requested name or ordinal.

    /spmanagerdownload/downloadadmin.asp, line 444


    
    	strSQL = "SELECT tblUsers.username, tblUsers.userType, tblUsers.Timestamp, tblUsers.Email, tblUsers.ID FROM tblUsers WHERE tblUsers.userType = 'Trial v3' AND tblUsers.username like '"&request.querystring("letter")& "%' ORDER BY username"
    Code (markup):

     
    danjapro, Feb 3, 2006 IP
  2. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    check the spelling of all of your variables. Look particularly at line 444, this error doesnt necessarily refer to your sql statement - this variable means that you are trying to call a variable that doesn't exist in your collection on line 444, which could be anything.

    VG
     
    vectorgraphx, Feb 5, 2006 IP
  3. chippi

    chippi Peon

    Messages:
    194
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    most probably you're confused variables or table and field names. if check it again , you understand. it's a common mistake of everyone.
     
    chippi, Feb 7, 2006 IP
  4. YIAM

    YIAM Notable Member

    Messages:
    2,480
    Likes Received:
    240
    Best Answers:
    0
    Trophy Points:
    280
    #4
    You my try it by replaceing '"Trial v3"'
    . Did it solve your problem
     
    YIAM, Feb 8, 2006 IP
  5. arnek

    arnek Active Member

    Messages:
    134
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    I don't think that would be it, please provide the code where you reference the resultset, remember, it is case sensitive(column name)
     
    arnek, Feb 8, 2006 IP
  6. fluid

    fluid Active Member

    Messages:
    679
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    70
    #6
    This error message usually means the fieldname you specified in your SQL query doesnt exist in the table you're selecting data from. So make sure you have the following in tblUsers:

    username, userType, Timestamp, Email and ID as fieldnames :)
     
    fluid, Mar 25, 2006 IP