Thanks to everyone for their assistance.
I have come up with a different solution than the ones you guys mentioned.
I am going to create a class object, maybe called CInteger and have 2
properties. Value, and IsNull.
This will be the return type for my integer fields.
I don't like using SQL data types as the idea for my data classes is for
them to be generic and not tied to any particular DBMS data types.
This is the best idea I could come up with. Let me know what you guys
think.
"Nick Malik [Microsoft]" <(E-Mail Removed)> wrote in message
news:4NOdnaU_GZYMYLrfRVn-(E-Mail Removed)...
> Don't define the data type to be 'int'. Use the SQL data types instead,
> like SqlInt32
> See
> http://msdn.microsoft.com/library/en...taSqlTypes.asp
>
>
> --
> --- Nick Malik [Microsoft]
> MCSD, CFPS, Certified Scrummaster
> http://blogs.msdn.com/nickmalik
>
> Disclaimer: Opinions expressed in this forum are my own, and not
> representative of my employer.
> I do not answer questions on behalf of my employer. I'm just a
> programmer helping programmers.
> --
> "D Witherspoon" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> What is the accepted method of creating a data class or business rules
>> object class with properties that will allow the returning of null
>> values?
>>
>> For example... I have a class named CResults with the following
>> properties.
>>
>> TestID int
>> QuestionID int
>> AnswerID int
>>
>> So, this is a simple example, but I want to be able to know if AnswerID
>> is null. I don't want to know that it is 0 or anything else. I want to
>> be able to have it return null (instead of the default "nothing" value of
>> 0)
>>
>> This is not my real world example, it is just an example I'm using to
>> explain what I want to do. I am developing a large scale application and
>> the properties of the classes can contain null or legitmate values. If
>> there is an integer property I want to know if it was 0 or null. There
>> is a huge difference, as 0 implies that literally 0 was entered into the
>> database, and null is that nothing has been entered in the database.
>>
>> How can I design my data classes using VB.NET to take this into account.
>> The intrinsic datatypes in VB (integer, long, string, etc) can not have
>> null values.
>>
>> What is common practice in this case?
>>
>>
>
>