Solved

Multiple Values for a Parameter and C#

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

11 Experts available now in Live!

Get 1:1 Help Now