Tiny detail-bug on the DAL? RRS feed

  • Question

  • User1046174173 posted
    In the AddParamToSQLCmd method, the param is added only when the value isn't null:

                if (paramValue != null)
                    newParam.Value = paramValue;

    but then NULL columns like ProjectDescription are filled with an empty string, instread of a NULL value (as far as I know having NULL is better), wouldn't be better to do:

                if (paramValue != null)
                    newParam.Value = paramValue;
                    newParam.Value = DBNull.Value;

    I was afraid that the return value wouldn't work if you added DBNull as as the value, but for all I know, it does work.

    What do you think?

    Monday, August 22, 2005 11:37 AM

All replies

  • User803728874 posted
    It depends what you code for. NULLs can be tricky.in sql. Perhaps not in the TimeTracker, but whether you use NULL or an empty string  is really decided on what you expect on queries; this is especially important in cases where you might be using count, concatenating strings, etc..
    Tuesday, October 18, 2005 10:32 PM
  • User-270387707 posted

    Are you guys using the DAL builder from dotnetnuke.dk ? Which version of it are you using ?


    FirstDev AB

    Friday, November 4, 2005 5:41 PM