Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSDB2 returns DBNULL for VARCHAR with length 0

Status
Not open for further replies.

JohnYingling

Programmer
Mar 24, 2001
3,742
0
0
US
When switching from DB2OLEDB to the MSDB2 managed provider with strongly type datasets, I encountered a "Cannot get value because it is DBNull". The field was defined in the DB2 database as VARCHAR. I included a WHERE field IS NOT NULL in the SQL but the row was still returned, verifying that the field was not NULL and suggesting that it exists and has a length = 0. So MSDB2 fills the datacolumn with DBNULL if the source field is VARCHAR with length = 0.

- free online Compare/Diff of snippets
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top