Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Check property value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shapper - 30 Oct 2007 20:13 GMT
Hello,

I have the following custom control property:

   ' Example
   Private _Example As String
   < _
   Bindable(True), _
   Category("Appearance"), _
   DefaultValue(""), _
   Localizable(True) _
   > _
   Property Example() As String
     Get
       Return _Example
     End Get
     Set(ByVal value As String)
       _Example = value
     End Set
   End Property ' Example

What is the difference between using:

If Me.Example = Nothing Then
If Me.Example Is Nothing Then
If String.IsNullOrEmpty(Me.Example) Then

Thanks,

Miguel
Alexey Smirnov - 30 Oct 2007 20:27 GMT
> Hello,
>
[quoted text clipped - 26 lines]
>
> Miguel

IsNullOrEmpty checks if string is a null or an Empty string ("").

According to the following bug report it might not work
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=
113102


"If Me.Example = Nothing Then" should be used with "IS" instead of "="

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.