473,657 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Test for empty System.Collecti ons.Specialized .NameValueColle ction

Hi.

I need to translate the C# statement:
if( this.validatorA ssignments != null &&
this.validatorA ssignments.HasK eys() )
where validatorAssign ments is an instance of
System.Collecti ons.Specialized .NameValueColle ction

into VB.Net

I have no clue how to test how the collection is null (empty) except to say:

If ( (Me.validatorAs signments.Count > 1) And
(Me.validatorAs signments.HasKe ys() = True) )

Thanks,

Phil
Boston, MA
Nov 21 '05 #1
3 4023
If Not (Me.validatorAs signments Is Nothing) AndAlso
Me.validatorAss ignments.HasKey s()
"Phil C." <ch********@rcn .com> wrote in message
news:us******** ******@tk2msftn gp13.phx.gbl...
Hi.

I need to translate the C# statement:
if( this.validatorA ssignments != null &&
this.validatorA ssignments.HasK eys() )
where validatorAssign ments is an instance of
System.Collecti ons.Specialized .NameValueColle ction

into VB.Net

I have no clue how to test how the collection is null (empty) except to
say:

If ( (Me.validatorAs signments.Count > 1) And
(Me.validatorAs signments.HasKe ys() = True) )

Thanks,

Phil
Boston, MA

Nov 21 '05 #2
Pil
if( this.validatorA ssignments != null &&
this.validatorA ssignments.HasK eys() ) If ( (Me.validatorAs signments.Count > 1) And
(Me.validatorAs signments.HasKe ys() = True) )

\\\
If Not validatorAssing nments Is Nothing AndAlso ValidatorAssign ments.HasKeys
///

I hope this helps,

Cor
Nov 21 '05 #3
Thanks Guys for the help


"Cor Ligthert" <no************ @planet.nl> wrote in message
news:O5******** *****@TK2MSFTNG P09.phx.gbl...
Pil
if( this.validatorA ssignments != null &&
this.validatorA ssignments.HasK eys() )

If ( (Me.validatorAs signments.Count > 1) And
(Me.validatorAs signments.HasKe ys() = True) )

\\\
If Not validatorAssing nments Is Nothing AndAlso
ValidatorAssign ments.HasKeys
///

I hope this helps,

Cor

Nov 21 '05 #4

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

Similar topics

0
1942
by: Todd Hampton | last post by:
I'm trying to write a small app that will screen scrape jobs from the Hire Texas site but have not been able to post to the search criteria page. Anybody have any insights? Thanks, Todd Dim strBuff As String Dim nvcFormParams As New System.Collections.Specialized.NameValueCollection()
4
15487
by: Justin Malloy | last post by:
I am using the System.Net.Webclient to try and download an XML file from a website but am receiving a HTTP protocol error when running the DownloadFile() sub routine. I did a HTTP trace using internet explorer to see what is happening in the request and it looks as though the request originates using HTTP/1.1 to an IIS server authenticates itself but ultimately gets executed by a Java Application server and when the request is fulfilled...
0
925
by: Jim Douglas | last post by:
{System.Collections.Specialized.ListDictionary.NodeKeyValueCollection} : {System.Collections.Specialized.ListDictionary.NodeKeyValueCollection} Count: 25 ?entry.Contains("MachineName") true
1
2206
by: Rein Petersen | last post by:
Hi Everyone! I hope someone may have experience serializing a NameObjectCollectionBase (System.Collections.Specialized) and can advise me as to why I receive this error (below) when I try to serialize my instance: System.InvalidOperationException: You must implement a default accessor on System.Collections.Specialized.NameObjectCollectionBase because it inherits from ICollection.
1
4877
by: Mark Miller | last post by:
I just recently started getting the above error on a page I am posting MULTIPART/FORM-DATA. We have SoftArtisans FileUp component and Filter installed on the server in question and up until a day or so ago everything was working fine. I honestly can't remember changing anything since it was last working. But I tried reinstalling the .Net Framework along w/ the service pack, which didn't work. I also had v1.1 already installed but I hadn't...
0
244
by: Hazzard | last post by:
I am trying to figure out how to add an additional value to a querystring collection so that when I click on a datagrid cell, there will be a key to distinguish it from another column's functionality. I have Edit and Delete columns that each contain the ColumnID for the record I want to either edit, or delete. When I pull the item of the collection on the target page's page_load event, I will be able to either invoke a delete or an edit...
1
3876
by: jmhmaine | last post by:
I've used the WebClient class on a few projects but I wanted to know if anyone could point to the good resource for Best Practices with this object. The two things I haven't seen in sample code are: 1. How to retrieve connection error messages, such as a DNS resolution error or connection dropped errors. 2. Should I use the Dispose or Finalize methods to destroy the object when I done? I assume that the object uses unmanaged code at some...
0
1719
by: John Grandy | last post by:
My business-layer class has a method that returns a System.Collections.Specialized.NameValueCollection I wrapped this business-layer class in a Web Service. In an ASP.NET project, when I attempt to add a Web Reference to this Web Service, I receive the error : You must implement the Add(System.String) method on System.Collections.Specialized.NameValueCollection because it inherits from
0
2283
by: fero | last post by:
Hello, I have the following problem. I have a page which works fine. But sometimes I see the following error in error log: -- Message: System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.NotSupportedException: Collection is read-only. at System.Collections.Specialized.NameValueCollection.Add(String name, String value)
0
8397
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7333
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.