Solved

Multiple Values for a Parameter and C#

Posted on 2004-03-28
1
249 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
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

823 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