473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How can I use a variable as the first parameter in a NameValueCollection?

Instead of:

NameValueCollection nvc=new NameValueCollection();

nvc.Add("A","Alpha");



I want to do:

nvc.Add(somevar, "Alpha")

Is there hashing going on against the key?

I have tried.... somevar = """ & myvar & """ and every other thing I can think of...

Please help...
Jun 26 '11 #1
1 1013
I figured it out with a little help. The problem is this:

nvc.Add(somevar, "Alpha") does work after all...the minor nuance is that it doesnt work for me if the variable has any spaces in the string being stored.

For example:

somevar = "THEKEY" works just fine, but
somevar = "THE KEY" doesn't work at all in my app.
Jun 26 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Richard L Rosenheim | last post by:
I'm trying to create a style sheet to generate HTML output, based upon some XML data. I'm grouping some data, and I'm trying to get the very first entry either just passed as a parameter, or...
2
by: ad | last post by:
I write a javascript function, it require a string parameter: <asp:TextBox ID="TextBox1" runat="server" onclick="MyJavascript('Tiger');"></asp:TextBox> I want bind a variable to the parameter,...
3
by: kd | last post by:
Hi All, I need to check whether an application is executing. I do not know the class name of the application; however, I know the window caption of the application. What would be the first...
6
by: Jody Gelowitz | last post by:
I have run into an issue with variable scope within an XSLT document that is translated in VS.NET 2.0. Under VS.NET 1.1 (XslTransform), this code works fine. However, when using VS.NET 2.0...
2
by: Gigsman | last post by:
public void Foo(string one) { one = "two"; } main() { string one = "one"; Foo(one);
1
by: ig.martix | last post by:
Is it possible to put a variable in parameter for a URL? I'm looking to have a page with an input box and a link. When someone puts in a value in the input box and clicks the link it will take...
4
by: David Sanders | last post by:
Hi, I have a class depending on a template parameter: template<int n> class MyClass { }; I want the template parameter to be chosen according to a variable, e.g.
2
by: GiJeet | last post by:
Hi, just learning extension methods and the first parameter confuses me. I understand using the this keyword to indicate the class we wish to extend, but is the first parameter also used to catch...
1
by: rsandes1 | last post by:
Hello, still a newbie here, Does anyone know how to use a session variable like "UserId" column as a parameter within a object data source. The options that I have are "querystring", "control",...
4
by: gchichester | last post by:
Is there a way to assign the data from and Input box of a parameter query to a variable? Here's the parameter for the query; ((DatePart('ww',,2,2))=)) I would like to assign the "Week Number"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.