Hi All,
I have a column on an SQL Server DB that is declared as type integer and is nullable.
I have a query that includes this column that is bound to a typed dataset.
This is the Typed Dataset's Property
How do I test for a null value against this or should I change the code above. As soon as It hits the row:Code:<Global.System.Diagnostics.DebuggerNonUserCodeAttribute()> _ Public Property RateableValue() As Integer Get Try Return CType(Me(Me.tableCustomerSystemFieldsAssetLocation.RateableValueColumn), Integer) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'RateableValue' in table 'CustomerSystemFieldsAssetLocation'" & _ " is DBNull.", e) End Try End Get Set(ByVal value As Integer) Me(Me.tableCustomerSystemFieldsAssetLocation.RateableValueColumn) = value End Set End Property
My app crashes with conversion error DBnull to integer.Code:Return CType(Me(Me.tableCustomerSystemFieldsAssetLocation.RateableValueColumn), Integer)




Reply With Quote