PC Review


Reply
Thread Tools Rate Thread

Confusion on nothing

 
 
John
Guest
Posts: n/a
 
      28th Aug 2006
Hi

I am confused over how to check for nulls (Nothing in vb.net?). For instance
I am trying to create user in my vb.net/asp.net app as below;

Dim newUser As MembershipUser = Membership.CreateUser(Username, Password,
Email, passwordQuestion, passwordAnswer, True, status)
If (newUser = Nothing) Then

But I get an "Operator '=' is not defined for types
'System.Web.Security.MembershipUser' and
'System.Web.Security.MembershipUser'. " error on the second line above. What
is the correct method to check for nothing in vb.net?

Thanks

Regards


 
Reply With Quote
 
 
 
 
Van den Driessche Willy
Guest
Posts: n/a
 
      28th Aug 2006
Use the "Is" operator
If (newUser is Nothing) Then

or the related (VS2005)
If (newUser isNot Nothing) Then


"John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I am confused over how to check for nulls (Nothing in vb.net?). For

instance
> I am trying to create user in my vb.net/asp.net app as below;
>
> Dim newUser As MembershipUser = Membership.CreateUser(Username, Password,
> Email, passwordQuestion, passwordAnswer, True, status)
> If (newUser = Nothing) Then
>
> But I get an "Operator '=' is not defined for types
> 'System.Web.Security.MembershipUser' and
> 'System.Web.Security.MembershipUser'. " error on the second line above.

What
> is the correct method to check for nothing in vb.net?
>
> Thanks
>
> Regards
>
>



 
Reply With Quote
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      28th Aug 2006
use the "is" keyword in vb.net

if user is nothing then


Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/


"John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I am confused over how to check for nulls (Nothing in vb.net?). For
> instance I am trying to create user in my vb.net/asp.net app as below;
>
> Dim newUser As MembershipUser = Membership.CreateUser(Username, Password,
> Email, passwordQuestion, passwordAnswer, True, status)
> If (newUser = Nothing) Then
>
> But I get an "Operator '=' is not defined for types
> 'System.Web.Security.MembershipUser' and
> 'System.Web.Security.MembershipUser'. " error on the second line above.
> What is the correct method to check for nothing in vb.net?
>
> Thanks
>
> Regards
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IE confusion Mist Windows XP General 11 20th Sep 2008 06:16 PM
ASP.Net confusion between 1.1 and 2.0 Brent Microsoft ADO .NET 4 26th May 2006 09:40 PM
Re: Can someone end my confusion ? fredg Microsoft Access Reports 0 5th Aug 2004 11:46 PM
xp/98 confusion NY1 Windows XP Basics 4 20th Mar 2004 01:16 AM
ADO.NET + VB.NET = Confusion James Microsoft VB .NET 9 9th Jan 2004 11:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:15 AM.