473,473 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

NameValueCollection.GetValues and array especification

I need to specify an string array as a value in a NameValueCollection in
web.config file

.........
<AA>
<BB>
<add key="P1" value=?????>
<add key="P2" value="String">
</BB>
</AA>
............
Which should be the format of ????? in order to work with the following
piece of code?

Dim Parameters as NameValueCollection
Dim P1() as String
Dim P2 as String

Parameters = CType(ConfigurationSettings.GetConfig("AA/BB"),
Specialized.NameValueCollection)

P1 = Parameters.GetValues("P1")
P2 = Parameters.Get("P2")

Thanks,

Alfons Puig
ap***@sisinf.com
Nov 17 '05 #1
1 2624
Store comma (or anyother charector) seperated value in the P1

e.g
<add key="P1" value="Element 1,Element 2, Element 3">

Then use "Split" to get each string into the array.
P1 = Split(Parameters.GetValues("P1"),",")
Shaji
www.DiverseInc.com

"Alfons Puig" <al*********@retemail.es> wrote in message
news:uS**************@TK2MSFTNGP10.phx.gbl...
I need to specify an string array as a value in a NameValueCollection in
web.config file

........
<AA>
<BB>
<add key="P1" value=?????>
<add key="P2" value="String">
</BB>
</AA>
...........
Which should be the format of ????? in order to work with the following
piece of code?

Dim Parameters as NameValueCollection
Dim P1() as String
Dim P2 as String

Parameters = CType(ConfigurationSettings.GetConfig("AA/BB"),
Specialized.NameValueCollection)

P1 = Parameters.GetValues("P1")
P2 = Parameters.Get("P2")

Thanks,

Alfons Puig
ap***@sisinf.com

Nov 17 '05 #2

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

Similar topics

5
by: anon | last post by:
I need a little clarity in the NameValueCollection. Within the MSDN .NET 1.1 Framework help is says: "This collection is based on the NameObjectCollectionBase class. However, unlike the...
2
by: smith | last post by:
It's a time saver to "bind" .Net enums to list and comboboxes and all the samples out there seem to use GetNames and GetValues pretty interchangeably. So I was wondering what the logic is to the...
0
by: john sutor | last post by:
Does anyone know how to use a NameValueCollection obj like a simple multi-dimensional array? I'm looking for a multi-dimensional array like VB had that can be resized without loosing any data.
7
by: davidw | last post by:
I always use NameValueCollection. But I read an article says the only differece between Hashtable and NameValueCollection is that NameValueCollection could accept more than one value with same key?...
4
by: Bernie Walker | last post by:
Can an individual value be changed or must the entire collection for a specific key be cleared and re added? Bernie.
0
by: Yuri Vanzine | last post by:
Saw this requested awhile ago on Matthew Reynolds's blog here: http://www.dotnet247.com/247reference/msgs/11/57944.aspx Problem: often times I deal with querystring-formatted strings w/o the...
1
by: Robin HOIZEY \(Hotmail\) | last post by:
Hi, I'm using the OdbcDataReader.GetValues method (.NET Framework 1.1) to populate an object array with the result of a SQL command. The Database engine is Oracle 9.0.2. When getting...
2
by: MrDotNet | last post by:
Hi I want pass NameValueCollection as parameter in webmethod. I try it but that give me error. Here is Error. You must implement the Add(System.String) method on...
1
by: Jeff Mason | last post by:
I am observing some puzzling behavior with the GetValues method of enumerations. I wonder if this something I just don't understand, or is this just wrong. The documentation for the GetValues...
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...
1
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...
0
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
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 ...
0
muto222
php
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.