I ran into this problem early on, so I ended up just adding a Check/Select
function pair for each data type. I know it's not the most efficient coding
method, but it works. Each Select function selects the value into an object
and returns the value of the Check function, which converts the object to
its specific data type, or returns 0 for numerics and "" for strings. Then
just put all of those functions in a global Query class or something along
those lines, and you can always access them easily.
Mike
Michael Caputo
Programmer/Database Administrator
Simon Economic Systems Ltd.
"Dan Keeley" <ma********@hotmail.com> wrote in message
news:8J*****************@newsfep4-winn.server.ntli.net...
Hi,
This is probably not a dotnet specific issue, however i'm using dotnet so
here goes,.
I'm setting a text value of a field like so:
txtFax.Text = currentRow("FaxNumber")
However depending on the row, this value may be null.
This throws an exception because "Cast from type DBNULL to type String is
not valid"
Whats the proper way to deal with this?
Do i really have check the returned value for every field and substitute
"" where necessary?
Thanks,
Dan