views:

6

answers:

0

I'm trying to use the methods from SvcProject.ProjectDataSet.ProjectRow, such as IsPROJ_INFO_CURRENT_DATENull to check if a certain property is null or not before I access it. However, whenever I try this, the method throws an ArgumentNullException saying that the column is null. Checking the stack trace, it's clear that the problem is actually in the code for Project Server itself (assuming that I have set everything up correctly).

I have currently come up with a workaround that is serving the purpose of checking for a null value:

DateTime currentDate;
DateTime statusDate;
try
{
    currentDate = row.PROJ_INFO_CURRENT_DATE;
}
catch (ArgumentNullException)
{
    currentDate = DateTime.MinValue;
}

try
{
    statusDate = row.PROJ_INFO_STATUS_DATE;
}
catch (ArgumentNullException)
{
    statusDate = DateTime.MinValue;
}

However, I don't really like this solution all that much - it's an awful lot of code for checking for null values. Has anyone else run into this problem? Am I doing something wrong?