Conversion from type "DBNill" to type "Integer" is not valid


Author
Message
Tiong Diu King
Tiong Diu King
StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)
Group: Forum Members
Posts: 28, Visits: 70
Hi all,

My BO get value cannot convert the null value to integer and show the error as image attached.
I did tried to change the get's coding in BO property as coding below and it's work. If i rebuild partial for that BO, it's coding back to original.
I'm license strataframe user and i got the framework coding. Please advice me how do i change the Generate BO code in strataframe framework.

   ''' <summary>
    ''' iPrdPeriodN_FK
    ''' </summary>
    <Browsable(False), _
     BusinessFieldDisplayInEditor(), _
     Description("iPrdPeriodN_FK"), _
     DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
    Public Property [iPrdPeriodN_FK]() As System.Int32
        Get
            'Return CType(Me.CurrentRow.Item("iPrdPeriodN_FK"), System.Int32)
                        If Convert.IsDBNull(Me.CurrentRow.Item("iPrdPeriodN_FK")) Then
                Return 0
            Else
                Return CType(Me.CurrentRow.Item("iPrdPeriodN_FK"), System.Int32)
            End If

        End Get
        Set(ByVal value As System.Int32)
            Me.CurrentRow.Item("iPrdPeriodN_FK") = value
        End Set
    End Property

Please advice and thanks
Attachments
DBNULL.JPG (63 views, 79.00 KB)
Tiong Diu King
Tiong Diu King
StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)
Group: Forum Members
Posts: 28, Visits: 70
Hi all,

Mr. Ivan did solved my question at http://forum.strataframe.net/Topic28265.aspx?Update=1
Thanks Ivan
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
You are welcome, Tiong. Wink
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search