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 SelectMemberHarvestPlanVol ume.usp_Se lectMember HarvestPla nVolumeDat aTable, 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.P arameters( 1).Value = CType(harvestPlanID.Value, System.Gui d)
Else
Me.Adapter.SelectCommand.P arameters( 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 .Parameter s(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. SelectComm and.Parame ters(0).Va lue,Intege r))
End If
End Function
The problem is with "System.Nullable.FromObjec t". 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.
Public Overloads Overridable Function Fill(ByVal dataTable As SelectMemberHarvestPlanVol
Me.Adapter.SelectCommand = Me.CommandCollection(0)
If (harvestPlanID.HasValue = true) Then
Me.Adapter.SelectCommand.P
Else
Me.Adapter.SelectCommand.P
End If
If (Me.m_clearBeforeFill = true) Then
dataTable.Clear
End If
Me.Adapter.Fill(dataTable)
If ((Me.Adapter.SelectCommand
OrElse (Me.Adapter.SelectCommand.
Return System.Nullable.FromObject
Else
Return New System.Nullable(Of Integer)(CType(Me.Adapter.
End If
End Function
The problem is with "System.Nullable.FromObjec
What needs to be changed to get this to work?
Thank you in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.