title: How to pass string array in SQL parameter to IN clause in SQL
body: <p>A logic which I am doing in a complex way.</p>
  
  <p>I just need to execute this query in a stored procedure:</p>
  
  <pre><code>select Sizes, SUM(Quantity)
  from tbl_SizeBreakup
  where (Brand=@brand)
    and (Combo in ('1','2')) ...
  </code></pre>
  
  <p>The combo I must pass in SQL parameter using in C# is</p>
  
  <pre><code>DataSet dt = new DataSet();
  cmd = new SqlCommand();
  cmd.CommandType = System.Data.CommandType.StoredProcedure;
  cmd.CommandText = "sp_Accessories";
  cmd.Connection = con;
  
  cmd.Parameters.AddRange(
      new SqlParameter[] {
          new SqlParameter("@Mode",mode),
          new SqlParameter("@Combo",combo),
      }}
  </code></pre>
  
  <p>So if I pass 1 parameter, working as expected. The combo which I should pass is a <code>string[]</code> (string array). The array length can be anything depends on the user selecting in UI. </p>
  
  <p>My question is, how to pass <code>string[]</code> to <code>new SqlParameter("@Combo",combo)</code>?</p>
  
  <p>My stored procedure..</p>
  
  <pre><code>ALTER proc [dbo].[sp_Accessories]
  (  
  @Mode varchar(50)=null,
  @id int=null,
  @brand varchar(50)=null,
  @department varchar(MAX)=null,
  @season varchar(50)=null,
  @groupname varchar(MAX)=null,
  @styles varchar(50)=null,
  @combo varchar(50)=null,
  @combo_color nvarchar(max)=null,
  )
  as
  if @Mode='getsizewise'
  begin
  select Sizes,SUM(Quantity) from tbl_SizeBreakup where (Brand=@brand) and (Department=@department) and (Season=@season) and (Group_Name=@groupname) and (Style=@styles) 
  and (Combo_Color=@color) and (Total_Add_Qty='Total Quantity') Group By Sizes
  end
  </code></pre>