|
-
Nov 13th, 2006, 04:05 AM
#1
Thread Starter
Lively Member
Nullable type
Hi,
How can I retrieve the base type from an nullable type?
For example, I've got a nullable Int64.
GetType would give me this: -
{Name = "Nullable`1" FullName = "System.Nullable`1[[System.Int64, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"} System.Type {System.RuntimeType}
However I want the type to contain System.Int64, not System.Nullable.
I need this because the type is going into a datatable, and I can't add columns with a nullable type in it.
-
Nov 13th, 2006, 04:16 AM
#2
Thread Starter
Lively Member
Re: Nullable type
Forgot to select my version; It's 2005.
-
Nov 13th, 2006, 11:53 AM
#3
Re: Nullable type
 Originally Posted by Guiseppe
Hi,
How can I retrieve the base type from an nullable type?
For example, I've got a nullable Int64.
GetType would give me this: -
{Name = "Nullable`1" FullName = "System.Nullable`1[[System.Int64, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"} System.Type {System.RuntimeType}
However I want the type to contain System.Int64, not System.Nullable.
I need this because the type is going into a datatable, and I can't add columns with a nullable type in it.
Hi,
Here's a link about Nullable Types;
http://msdn2.microsoft.com/en-us/library/1t3y8s4s.aspx
Hope it helps,
sparrow1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|