SQL query not taking values more than 2100

Posted by user175084 on Stack Overflow See other posts from Stack Overflow or by user175084
Published on 2010-06-15T21:07:31Z Indexed on 2010/06/16 3:32 UTC
Read the original article Hit count: 258

Filed under:
|
|
|
|
SELECT MachineID, MachineName, count(ID) as Total, sum(Size) as TotalSize 
  FROM Files 
  join Machines on Files.MachineID = Machines.MachineID 
 Where Files.MachineID In(sql.Append(string.Format("@MachineId{0}", i));
 group by Files.MachineID,MachineName

now when the machinId count is less than 2100 the query is performed and if it machines go above 2100 an error is thrown Error:

The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100.

how do i make increase the limit or just avoid getting this error.. and put values in gridview thanks..

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET