Invalid cast when trying to reference a database column...

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Getting and error on this first line of code:


//inspector phone
theField = reader.GetString(20);
builder.MoveToBookmark("inspector_phone");
builder.Write(theField);

the first line is crashing my program. it complains about an invalid
cast. i don't understand why though. I tried putting a IsDBNull around
it (thinking the data might be null) but that does not seem to help.
the field is declared as a string and reader is a connection to my
Oracle database.

Any help appreciated.

.



Relevant Pages

  • Re: Invalid Time with SDFiler 1.0
    ... and that bad rounding took place. ... field could be MOD 60 to prevent it from crashing the filer. ... In case the file timestamp has an invalid seconds field such as ...
    (comp.sys.hp48)
  • counter.li.org madness
    ... my machine-update script from there complains about a ... "Invalid or incomplete multibyte or wide character" when started with -m to ...
    (alt.os.linux)
  • IE keeps crashing w/error message
    ... IE keeps crashing, and I get this error message (as well as ... EXPLORER caused an invalid page fault in ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: generic interface real function vs real
    ... and other compilers certainly did accept it but ... Lahey also complains. ... unambiguous, but still invalid, because: "the rules do not distinguish on ...
    (comp.lang.fortran)
  • Re: alpine, gpg and non-ascii chars
    ... using claws (which complains that the signature is invalid). ... If I use non-us characters and DON'T sign the mail. ...
    (comp.mail.pine)