Solved

can I make namevaluecollection with non-comma delimited values

Posted on 2008-10-03
2
513 Views
Last Modified: 2013-11-07
If I build a namevaluecollection by looping through a datatable, the nvc will automatically concatenate new values onto any exisitng ones with the same key. This feature is helpful for they way my data looks, so I'd like to keep the nvc and not try to use a hashtable, for instance.

But some of my values are messages containing commas, which will cause problems when I try to split those values later.

Is there a way to set the nvc's delimiter to be something other than a comma?
0
Comment
Question by:waltraud2000
2 Comments
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 300 total points
ID: 22641041
Use the GetValues() method, in conjunction with String.Join to get a delimited string....

    String.Join("|", nvc.GetValues(index:=3))

Note that if you use the GetValues() method, you do not need to split the resulting string, as it returns a string array.

Wayne
0
 

Author Closing Comment

by:waltraud2000
ID: 31503559
Didn't quite solve the problem the way i wanted to, but it was useful nevertheless
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now