Hello
I have a List<int> containing my values for find my items with "FieldCompareSetPredicate ".
Code snippet as follow.
var logids = new List<int> (); May contain more than 3000 items.
predicateExpression.Add (new FieldCompareSetPredicate (ProcessLogBinaryFields.LogId, null, ProcessLogBinaryFields.LogId, null,
SetOperator.IN, ( ProcessLogBinaryFields.LogId == logids.ToArray () )));
This generates a "FIELD IN" with thousands of values for filtering with this error.
Have i reach some kind of limit?
"..
SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException was caught
HResult=-2146232832
Message=An exception was caught during the execution of a retrieval query: A severe error occurred on the current command. The results, if any, should be discarded.
A severe error occurred on the current command. The results, if any, should be discarded.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
Source=SD.LLBLGen.Pro.ORMSupportClasses
RuntimeBuild=10252013
RuntimeVersion=4.1.0.0
QueryExecuted=
Query:
SELECT
FileName
, ID AS Id
, IDate AS Idate
, IUser AS Iuser
, LogBlobData
, LogID AS LogId
FROM ProcessLogBinary
WHERE ProcessLogBinary.LogID IN (@p1, @p2, @p3, @p4, and continious more than 2000.
InnerException: System.Data.SqlClient.SqlException
HResult=-2146232060
Message=A severe error occurred on the current command. The results, if any, should be discarded.
A severe error occurred on the current command. The results, if any, should be discarded.
Source=.Net SqlClient Data Provider
ErrorCode=-2146232060
Class=11
LineNumber=0
Number=0
Procedure=""
Server=fagusdb
State=0
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.1\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Query\RetrievalQuery.cs:line 109
InnerException:
.."
However, I could do a foreach on my list but then i have to do one read per item to the database instead of one.