473,395 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1395
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

4
by: middletree | last post by:
I am doing an Intranet-based app. For one set of pages on the app, I want to grab the user's network logon ID. I have chosen to do this with this code:...
2
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
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...
13
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
by: Richard Lewis Haggard | last post by:
I'm having a problem with what appears to be some sort of confusion with references. I have a single solution with a dozen projects which has been working quite nicely for a while. The references...
1
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
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 =...
21
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
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.