Link to home
Start Free TrialLog in
Avatar of purfus
purfus

asked on

System.Nullable.FromObject - Not valid with VS 2005

I was previously using VS 2005 Beta 2 and just upgraded to the released version of VS 2005 Pro.  Everything seems to work fine except for 2 forms (out of 30).   After opening my project in VS I attempted a build and it came back with an error.  There were no errors the last time I worked with the Beta version.   The error is in the Designer file for the form.   Here's the code in question:

Public Overloads Overridable Function Fill(ByVal dataTable As SelectMemberHarvestPlanVolume.usp_SelectMemberHarvestPlanVolumeDataTable, ByVal harvestPlanID As System.Nullable(Of System.Guid)) As System.Nullable(Of Integer)
            Me.Adapter.SelectCommand = Me.CommandCollection(0)
            If (harvestPlanID.HasValue = true) Then
                Me.Adapter.SelectCommand.Parameters(1).Value = CType(harvestPlanID.Value,System.Guid)
            Else
                Me.Adapter.SelectCommand.Parameters(1).Value = System.DBNull.Value
            End If
            If (Me.m_clearBeforeFill = true) Then
                dataTable.Clear
            End If
            Me.Adapter.Fill(dataTable)
            If ((Me.Adapter.SelectCommand.Parameters(0).Value Is Nothing)  _
                        OrElse (Me.Adapter.SelectCommand.Parameters(0).Value.GetType Is GetType(System.DBNull))) Then
                Return System.Nullable.FromObject(Of Integer)(Nothing)
            Else
                Return New System.Nullable(Of Integer)(CType(Me.Adapter.SelectCommand.Parameters(0).Value,Integer))
            End If
        End Function

The problem is with "System.Nullable.FromObject".  VS says that "FromObject is not a member of System.Nullable".  

What needs to be changed to get this to work?

Thank you in advance.
ASKER CERTIFIED SOLUTION
Avatar of dave4dl
dave4dl

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial