Solved

Multiple Values for a Parameter and C#

Posted on 2004-03-28
1
252 Views
Last Modified: 2006-11-17
Hi, I have this code that i want to allowcate multiple values to a parameter, but it seems to be only assigning the last value to the parameter.

Heres the Code:

string sTemp = myParam.lstItems[i];
string [] split = null;
split = sTemp.Split('~');
foreach (string s in split)
{
      //Get Parameter Values
      dcParam.Value = s;
      //Debug
      DBG.DBG("Value = [" + dcParam.Value.ToString() + "]");
      //Assign Parameter Values
      pfParam.CurrentValues.Add(dcParam);            
}

What is suppose to do is split the delimited string into segments,( this is working) then for each segment assigne the Current value to the pfParam variable.

Could anyone help??
0
Comment
Question by:cossy74
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
DarrenZai earned 500 total points
ID: 10701484
I think you need to use the CreateSingleValue function to create a value object and then use that in the add method.

dcParam = pfParam.CreateSingleValue
dcParam.Value = s
pfParam.CurrentValues.Add(dcParam)
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

732 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