Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an application having excel like filter and got exception while apply filter in Data View...
The filter expression length is 112253 and expression string is like (1=1 and ( strDate='03-Jun-2014 00:03' Or strDate='03-Jun-2014 04:08' Or strDate='03-Jun-2014 04:09' ..............)


The exception is:

An unhandled exception of type 'System.StackOverflowException' occurred in System.Data.dll
Posted
Comments
jdeep84 12-Jun-15 4:20am    
whoa... seems you are stress testing BCL :).

BTW looks like there is some race condition which is going in infinite loop, try parsing your filter expression step by step and identify root cause.

All the best.
Mayank_1986 15-Jun-15 6:10am    
I have already parse the filter expression but it seems that there are some limitation for filter expression in DataView.
Also in this the code is not going to catch block...
jdeep84 16-Jun-15 5:59am    
Do you mean... while u execute step by step i.e. one expression at a time does not throw exception? and executing all at once throwing some exception?
Mayank_1986 17-Jun-15 1:05am    
yes...
jdeep84 17-Jun-15 3:51am    
okay.. so i would suggest may be try reordering the filter or just choose a step by step way using some async mechanism for better performance.

1 solution

The answer to your problem is simplify your filter.

Try to filter the data at source rather than in the data view itself

If you are really going to down to the level of checking for specific times then use a range comparison, don't list all of the individual times.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900