views:

19

answers:

0

I have to display some data (I am using teleriks grid with ajax binding) but there are problems with the data I have.

For example, a lot of records have null values for the foreign keys, like as an example

Let's say we have a table with a lot of foreign key references, like CategoryID, LocationID, FoodTypeID, etc etc (I am just making this up) and inside that, often the ID's will be null. Which is incorrect, but the customer still wants the data available, so I guess in the future they could go ahead and fix the values up themselves.

So as such, how should I go about displaying these without throwing NullReference, and without setting my own rule like if LocationID is null make LocationID 0, because that of course then links to a specific location which may or may not be true. As the data stands at the moment, in the category, location, or foodtype columns there may or may not be a value like "UNKNOWN" which I can set (if I was to make my own rule)