Best way to get a nameValueCollection from a string
Posted on 2004-09-06
Right now I am writing a messy function which takes a string like this:
"Server=bigpc;Database=saleo;UID=bob; PWD=kevin123;Connect Timeout=60;"
splits it into an array of strings and tries to put each nameValuePair into a nameValueCollection.
My question is, is there a simpler/quicker/neater/standarder way to do this?
I know you can do this:
Dim nvc As New NameValueCollection(Request.QueryString)
So I tried to make the string look exactly like a valid query string and stick it in there but it doesn't work.
So is there a better way? using another object (not nvc) is fine. Thanks.