title: Passing a List<string> to a stored procedure
body: <p>I have a string list and i need to check if any of the values in the list contains in the database table.if exists return the data set of existing values.</p>
  
  <pre><code>public DataSet CheckDocumentNumber(List&lt;string&gt; DocNumber)
  {
     DataSet DocNum = new DataSet();
     SqlTransaction transaction = DALDBConnection.SqlConnection.BeginTransaction();
  
     try
     {
        string[] taleNames = new string[1];
        taleNames[0] = "DocNum";
        SqlParameter[] param = new SqlParameter[1];
        param[0] = new SqlParameter("@DocNumber", DocNumber);
  
        SqlHelper.FillDataset(transaction, CommandType.StoredProcedure, "spCheckDocNumber", DocNum, taleNames, param);
        transaction.Commit();
     }
     catch (Exception e)
     {
        transaction.Rollback();
     }
  
     return DocNum;
  }
  </code></pre>
  
  <p>My stored procedure is </p>
  
  <pre><code>CREATE PROCEDURE spCheckDocNumber
      @DocNumber VARCHAR(MAX)
  AS
  BEGIN
     SELECT * FROM tblDocumentHeader WHERE DocumentNumber = @DocNumber
  END
  </code></pre>
  
  <p>I need to know that how do I have to pass the list to the stored procedure and how to check the list with in the procedure. plz help</p>