Results 1 to 4 of 4

Thread: Nullable Data Extension Methods

Threaded View

  1. #3
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Nullable Data Extension Methods

    John, was there a reason that you didn't use a generic method? Such as:

    vb.net Code:
    1. Public Function GetNullable(Of T As Structure)(ByVal source As Common.DbDataReader, _
    2.                                                ByVal name As String) As T?
    3.     Dim ordinal As Integer = source.GetOrdinal(name)
    4.  
    5.     Return If(source.IsDBNull(ordinal), _
    6.               New T?(), _
    7.               DirectCast(source.GetValue(ordinal), T?))
    8.  
    9. End Function
    Last edited by ForumAccount; Aug 31st, 2010 at 09:05 AM. Reason: swapped

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