DBNull
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
25-10-17 05:09 PM
Hi guys, I'm just wondering if anybody has come across the DBNull issue?
When returning data into a collection (via a sql query in my case), I have some null values, the problem I am facing is when I try do anything with that collection I get the "DBNull" error.
Has anybody experienced this issue before?
TIA
2 REPLIES 2
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-10-17 11:12 AM
DBNull means that the record in the database does not contain a value.
Have you tried changing your query to not output null values?
something like,
SELECT Field
FROM Table
WHERE Not(Field) is null;
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-10-17 01:09 PM
There isn't a BP value that corresponds to DBNull, so the best policy is to avoid returning DBNull from your query. For example SELECT ColumnThatCannotBeNull1, ISNULL(ColumnThatMightBeNull, '') AS ResultThatWillNotBeNull
