title: Where In Clause error on The server support a maximum of 2100 parameters only
body: <p>I'm currently trying to try catch the insert SQL query from my simple C# application, but when i'm trying to insert the data into database with user id which is added into userIDList parameter, the error came out saying that</p>
  
  <blockquote>
    <p>The incoming request has too many parameters. The server supports  a
    maximum of 2100 parameters.</p>
  </blockquote>
  
  <p>The userIDList sometimes will contains like 60 arrays above then the error will popped out.</p>
  
  <p>My SQL CommandText will contain of </p>
  
  <pre><code>"SELECT * FROM TIME_ATTENDANCE_REPORT WHERE TRXDATETIME = @Date AND USERID IN (001,002,003,004,....)
  </code></pre>
  
  <p>So i think if more then certain number then the error popped out</p>
  
  <p>Here are my sample code :</p>
  
  <pre><code>List&lt;string&gt; userIDList = new List&lt;string&gt;();
  using (SqlCommand sqlDBComm = new SqlCommand())
                      {
                          openConnection();
                          SqlDataReader sqlDBReader;
                          sqlDBReader = null;
                          sqlDBComm.CommandText = "SELECT * FROM TIME_ATTENDANCE_REPORT WHERE TRXDATETIME = @Date AND USERID IN (" + string.Join(",", userIDList) + ") ORDER BY USERID ASC ";
                          sqlDBComm.Parameters.Add("@Date", SqlDbType.DateTime);
                          sqlDBComm.Parameters["@Date"].Value = GetDateFrom;
                          sqlDBComm.Connection = sqlDB;
                          sqlDBComm.CommandType = CommandType.Text;
                          try
                          {
                              sqlDBReader = sqlDBComm.ExecuteReader();
                              t.Load(sqlDBReader);
                              sqlDBReader.Close();
  
                              if (t.Rows.Count &gt; 0)
                              {
                                  status = "Update";
                              }
                              else
                              {
                                  status = "Insert";
                              }
                          }
                          catch (Exception errMsg)
                          {
                              MessageBox.Show("Error Code: " + errMsg.ToString());
                          }
                          finally
                          {
                              sqlDBReader.Close();
                              closeConnection();
                          }
                      }
  </code></pre>
  
  <p>Any other solution can resolve this?
  Thanks</p>