title: Get all data from a list WCF
body: <p>I pass a string to my WCF service like this</p>
  
  <pre><code>http://localhost:49854/Service1.svc/rest/getData/station_number=("31098","31508","31273")
  </code></pre>
  
  <p>My IService:</p>
  
  <pre><code>[OperationContract]
      [WebInvoke(Method = "*" ,ResponseFormat = WebMessageFormat.Json,RequestFormat = WebMessageFormat.Json, UriTemplate = "getData/station_number=({number})")]
      IEnumerable&lt;Data&gt; getData(string number);
  </code></pre>
  
  <p>Then that string will be cut into smaller piece by <code>,</code> then add to a list, after that i will loop though that list then get data that match list member like this:</p>
  
  <pre><code>public class Service1 : IService1
  {
      public IEnumerable&lt;Data&gt; getData(string number)
      {
          string cs = ConfigurationManager.ConnectionStrings["Bokeh_data"].ConnectionString;
          List&lt;string&gt; new_list = new List&lt;string&gt;();
          new_list = number.Split(',').ToList();
          List&lt;Data&gt; data_cont = new List&lt;Data&gt;();
          Data dt = new Data();
          for (var i = 0; i&lt; new_list.Count; i++)
          {
              using (SqlConnection conn = new SqlConnection(cs))
              {
                  SqlCommand cmd = new SqlCommand("GetData_byvalue", conn);
                  cmd.CommandType = CommandType.StoredProcedure;
                  cmd.Parameters.Add("@number", SqlDbType.VarChar, 50).Value = new_list[i];
                  conn.Open();
                  SqlDataReader reader = cmd.ExecuteReader();
                  while(reader.Read())
                  {
                      dt.bike_number = reader["Bike_number"].ToString();
                      dt.start_station = reader["Start_station"].ToString();
                      dt.start_station_num = reader["Start_station_numb"].ToString();
                      data_cont.Add(dt);
                  }
              }
  
          }
          return data_cont;
      }
  </code></pre>
  
  <p>My procedure:</p>
  
  <pre><code>CREATE PROCEDURE GetData_byvalue(@number nvarchar(50))
  AS
  BEGIN
   SELECT * FROM data WHERE Start_station_num = @number
  END
  </code></pre>
  
  <p>But i can only get one last <code>Start_station_num</code> at a time e.g <code>"31273"</code>(I have all three <code>Start_station_num</code> in my table) maybe because my Loop or my string is wrong ?</p>
  
  <p>Here is what i got from WCF:
  <a href="https://i.stack.imgur.com/5GtZz.png" rel="nofollow noreferrer">unexpected result</a></p>