Results 1 to 3 of 3

Thread: Nullable type

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    68

    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.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    68

    Re: Nullable type

    Forgot to select my version; It's 2005.

  3. #3
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: Nullable type

    Quote 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
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width