473,509 Members | 6,048 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Confusion on nothing

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
Aug 28 '06 #1
2 4922
Use the "Is" operator
If (newUser is Nothing) Then

or the related (VS2005)
If (newUser isNot Nothing) Then
"John" <Jo**@nospam.infovis.co.ukwrote in message
news:OY*************@TK2MSFTNGP05.phx.gbl...
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


Aug 28 '06 #2
use the "is" keyword in vb.net

if user is nothing then
Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"John" <Jo**@nospam.infovis.co.ukwrote in message
news:OY*************@TK2MSFTNGP05.phx.gbl...
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


Aug 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1847
by: Dinkster | last post by:
BackGround: - We are new to ASP - We thought we would experiment with using the session object (in proc) to store a small amount of data. - We get different results when cookieless is set to...
0
1385
by: i_have_control | last post by:
I'd be grateful for any input on this one: I have three web domains. The destinations of two are set to folders on the first, though that fact is transparent to the user (i.e: it does not...
6
1695
by: Bob Day | last post by:
VS 2003 The documentation says " Nothing keyword represents the default value of any data type" this is simply not true and causing a lot of problems. 1) Consider an SQL table of 3 columns: ...
13
2072
by: Steve | last post by:
I have a form with a dataset and a datagrid. I created a dataview on this dataset. When the user modifies the datagrid, I look up this record in the dataview to make sure it is unique. Here is...
1
1367
by: UJ | last post by:
I am doing development on a machine and everything was working fine. The name of the project was ECS to I made all my references as ~/ECS/... Worked great. Put it on the final server running...
2
1397
by: John | last post by:
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 =...
4
1544
by: VK | last post by:
As per discussion in the thread http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/117e4f3a30f4d1c3 I'm proposing to add new FAQ entry: ...
4
2028
by: Joergen Bech | last post by:
I sometimes use delegates for broadcasting "StateChanged" events, i.e. if I have multiple forms and/or controls that need updating at the same time as the result of a change in a global/common...
21
1824
by: globalrev | last post by:
i have a rough understanding of lambda but so far only have found use for it once(in tkinter when passing lambda as an argument i could circumvent some tricky stuff). what is the point of the...
8
2374
by: vaib | last post by:
hi all , It really seems that C never ceases to amaze . All this time i've been doing C and i thought i was quite adept at it but i was wrong . So without wasting any more time , here's the...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7347
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7416
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5062
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.