Results 1 to 3 of 3

Thread: Conversion Error

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2021
    Posts
    66

    Conversion Error

    Hi,

    I have the following code:

    Code:
      Dim nationalID As String = Autoreader.GetValue(0)

    E.g., of nationalID include: A2352, 263287, A3643724B

    At runtime I receive the error message:

    Code:
    Conversion from string "A2352" to type 'Double' is not valid.
    Any help please

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,470

    Re: Conversion Error

    You're not getting that exception on that line of code, unless there's something in that GetValue method that you're not telling us about. Where is the exception actually thrown? The stack trace will tell you.

    By the way, I'm assuming that Autoreader is a data reader of some sort. We shouldn't have to assume or guess though, because you should be providing us with all the relevant information.

  3. #3
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    6,379

    Re: Conversion Error

    What line are you getting that error on?
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

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