I have the following web service function-
[ServiceContract]
public interface ITest
{
[OperationContract]
double Sum(double a, double b);
}
public class Test : ITest
{
public double Sum(double a, double b)
{
double answer = a + b;
return answer;
}
And I am implementing it using this –
double a = double.Parse(textBox1.Text);
double b = double.Parse(textBox2.Text);
double sum = sc.Sum(a, b);
My problem being this only handles two doubles, how could I get it to handle several from just one text box, i.e. 1,2,3,4 with the response being 10?
If it wasn’t a web service you could use a special keyword
params, likeBut web services don’t know what
paramsmeans so you would need to use something likeList<double>ordouble[], e.g.