title: list to handle array of doubles
body: <p>Is there a way to handle a list of doubles I can handle ints with the code below but not sure how to handle array of doubles.</p>
  
  <pre><code>    {
  CalculateSumOfList.ServiceReference1.Service1SoapClient client = new CalculateSumOfList.ServiceReference1.Service1SoapClient();
  CalculateSumOfList.ServiceReference1.ArrayOfInt arrayOfInt = new CalculateSumOfList.ServiceReference1.ArrayOfInt();
  arrayOfInt.AddRange(listDouble); // error here!
  string result = client.CalculateSum(arrayOfInt);
  label1.Text = Convert.ToString(result);
  
      }
  </code></pre>
  
  <p>This is all wrong tho I need instead of ArrayOfInt to have Array of double?</p>
  
  <p>Client Side:</p>
  
  <pre><code>    namespace CalculateSumOfList
      {
          public partial class Form1 : Form
          {
  
              List&lt;Double&gt; listDouble = new List&lt;Double&gt;();
  
  
              public Form1()
              {
                  InitializeComponent();
              }
              private void Form1_Load(object sender, EventArgs e)
              {
  
              }
              private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
              {
  
              }
  
              private void button1_Click(object sender, EventArgs e)
              {
  
                  listDouble.Add(Convert.ToDouble(textBox1.Text));
  
                  textBox1.Clear();
                  listBox1.Items.Clear();
                  for (int i = 0; i &lt; listDouble.Count; i++)
                  {
                      listBox1.Items.Add(listDouble[i]);
                  } 
  
                  textBox1.Clear();
                  listBox1.Items.Clear();
                  for (int i = 0; i &lt; listDouble.Count; i++)
                  {
                      listBox1.Items.Add(listDouble[i]);
                  }
              }
  
              private void button2_Click(object sender, EventArgs e)
              {
                  CalculateSumOfList.ServiceReference1.Service1SoapClient client = new CalculateSumOfList.ServiceReference1.Service1SoapClient();
                  CalculateSumOfList.ServiceReference1.ArrayOfInt arrayOfInt = new CalculateSumOfList.ServiceReference1.ArrayOfInt();
                  arrayOfInt.AddRange(listDouble); // error here!
  string result = client.CalculateSum(arrayOfInt);
  label1.Text = Convert.ToString(result);
  
  
  
              }
  
  
  
          }
      }
  </code></pre>
  
  <p>Web Method:</p>
  
  <pre><code>namespace CalculateWebServiceSum
  {
      /// &lt;summary&gt;
      /// Summary description for Service1
      /// &lt;/summary&gt;
      [WebService(Namespace = "http://tempuri.org/")]
      [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
      [System.ComponentModel.ToolboxItem(false)]
      // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
      // [System.Web.Script.Services.ScriptService]
      public class Service1 : System.Web.Services.WebService
      {
  
          [WebMethod]
  
  
          public string CalculateSum(List&lt;double&gt; listDouble)
          {
              return listDouble.Sum().ToString();
  
  
  
          }
      }
  }
  </code></pre>