C# 2.0 Nullable Types

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to assign null values to datetime fields
Where I can find types like NullableDateTime or NullableInt.
TIA
 
I need to assign null values to datetime fields
Where I can find types like NullableDateTime or NullableInt.

The types are DateTime? and int? (i.e. the non-nullable value type
with a question mark appended to it).


Mattias
 
The Nullable support is implemented in terms of generics so you'd be looking at

Nullable<int> i

However, C# has a new syntax to save you some typing using ? do you'll have

int? i = null;
DateTime? d = null;

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

I need to assign null values to datetime fields
Where I can find types like NullableDateTime or NullableInt.
TIA

[microsoft.public.dotnet.languages.csharp]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top