|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How do I send null values to an integer type variable?Hello,
I posted this question couple of days ago here in the forums. http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_thread/thread/6aaddaaf69696722?hl=en Thanks -L "Learner" <pra***@gmail.com> schrieb: .... and you got working replies. What's the problem?> I posted this question couple of days ago here in the forums. > http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_thread/thread/6aaddaaf69696722?hl=en -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Hello Herfired,
I tried with this as Dim PullAhead As Nullable(Of Boolean) PullAhead = Nothing If _lblpullahead.Visible = True Then PullAhead = Convert.ToInt32(_drplPullAhead.SelectedValue.Trim) End If but when I send this as a parameter to a method in my Business Layer its throwing this error ********************************************************************************************* System.InvalidOperationException was unhandled by user code Message="Nullable object must have a value." Source="mscorlib" StackTrace: at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Nullable`1.op_Explicit(Nullable`1 value) at DealerQuestionsUS._btnGround_Click(Object sender, EventArgs e) in D:\VSProjects\GroundingDemo\GroundingDemo\DealerQuestionsUS.aspx.vb:line 143 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ******************************************************************************************** Am I missing some thing here? the code is exactly the same as we discussed in our previous postings. Thanks -L Herfried K. Wagner [MVP] wrote: Show quoteHide quote > "Learner" <pra***@gmail.com> schrieb: > > I posted this question couple of days ago here in the forums. > > http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_thread/thread/6aaddaaf69696722?hl=en > > ... and you got working replies. What's the problem? > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> Show the code where you get the error
Also, why are you defining PullAhead as a nullable boolean and then put an integer in it? /claes "Learner" <pra***@gmail.com> wrote in message I tried with this asnews:1155211337.991868.155680@75g2000cwc.googlegroups.com... Hello Herfired, Dim PullAhead As Nullable(Of Boolean) PullAhead = Nothing If _lblpullahead.Visible = True Then PullAhead = Convert.ToInt32(_drplPullAhead.SelectedValue.Trim) End If but when I send this as a parameter to a method in my Business Layer its throwing this error ********************************************************************************************* System.InvalidOperationException was unhandled by user code Message="Nullable object must have a value." Source="mscorlib" StackTrace: at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Nullable`1.op_Explicit(Nullable`1 value) at DealerQuestionsUS._btnGround_Click(Object sender, EventArgs e) in D:\VSProjects\GroundingDemo\GroundingDemo\DealerQuestionsUS.aspx.vb:line 143 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ******************************************************************************************** Am I missing some thing here? the code is exactly the same as we discussed in our previous postings. Thanks -L Herfried K. Wagner [MVP] wrote: Show quoteHide quote > "Learner" <pra***@gmail.com> schrieb: > > I posted this question couple of days ago here in the forums. > > http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_thread/thread/6aaddaaf69696722?hl=en > > ... and you got working replies. What's the problem? > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/>
Referencing Controls created at run time.
FileListBox from VB6? MS VB Newbie Tutorial Check to see if a server is running Check if a Windows service running Dataset End all running code of .dll Class item not accessible because it's private... but it's not? Description of Function Writing to a file opened in another class |
|||||||||||||||||||||||