SafeDataReader feature

SafeDataReader feature

Old forum URL: forums.lhotka.net/forums/t/4595.aspx


ShawnShaddock posted on Tuesday, April 01, 2008

    I was inspired by the SafeDataReader in CSLA so I decided to implement my own but I provided an overload for every Get function which would take a nullValue parameter incase you don't want the default null value back.

    Public Function GetInt32(ByVal name As String, nullValue As Integer) As Integer

This is useful for something like...

    Dim baudRate As Integer = dataReader.GetInt32("BaudRate", 9600)

Where if the BaudRate column is null we just want to use our default which is 9600.

I think this would be a nice feature in the CSLA SafeDataReader.

RockfordLhotka replied on Wednesday, April 02, 2008

Good idea, I'll add this to the wish list.

Copyright (c) Marimer LLC