Solved

Multiple Values for a Parameter and C#

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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. …
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

807 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