Results 1 to 2 of 2

Thread: The dreaded ADO.Net...

  1. #1

    Thread Starter
    Hyperactive Member SjR's Avatar
    Join Date
    Jul 2001
    Location
    Birmingham, UK
    Posts
    336

    The dreaded ADO.Net...

    VB Code:
    1. Dim drLibraries As SqlDataReader
    2. Me.cmdSelectLibraries.Parameters("@AddressCode").Value = Me.AddressCode
    3. Me.connBCMS.Open()
    4. drLibraries = cmdSelectLibraries.ExecuteReader

    I keep thinking I've got to grips with ADO.Net... but then this keeps bloomin' happening.

    Error on the last line shown above... "System Error"

    Me.cmdSelectLibraries is a SQLCommand Object (with correctly functioning connection object - tested )
    Me.connBCMS is the very same fully functional connection object.
    The command text is:
    "SELECT * FROM MemberOfList WHERE (AddressCode = @AddressCode)"
    Me.AddressCode property is set to a valid value (ie. 3)
    The datatype of the parameter is set to Int.

    Something very basic missing, and I keep making this mistake.
    Anyone spot it?
    Another satisfied customer

  2. #2

    Thread Starter
    Hyperactive Member SjR's Avatar
    Join Date
    Jul 2001
    Location
    Birmingham, UK
    Posts
    336
    Ermm, well, in this case it was a syntax error in the command text
    there isn't a column called AddressCode in that table
    But, I do get this problem in other similar circumstances where it isn't dumb operator error...
    When I have an example.........
    Another satisfied customer

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