Hello Everybody,
I have the following problem.
I have a large database table (inside a MS Sql-database) which I read inside a DataTable object. The DataTable object itself is bound to a DataGridView object where I show the data. Sometimes I would like to hide some data, which is not relevant for the current view. The DataView object inside the DataTable seems to be the best way to do this. DataView has a property RowFilter where you can set the visible rows. The input to RowFilter is a sql string. Unfortunately, I get a stack overflow exception when the string becomes too long. The following happens when then:
“An unhandled exception of type 'System.StackOverflowException' occurred in System.Data.dll”
I have already tried to split the string and call RowFilter several times but this would override the old settings. The same happens when calling "Select" function from the DataTable object.
Do someone have a similar problem and find a solution.
Below, I have scheduled my code:
Thank you for all help
Sahit
DataTable sourceTable = new DataTable();
SqlStringBuilder filter = new SqlStringBuilder();
intFamilyID = '6') .........................}
sourceTable.DefaultView.RowFilter = = filter.ToString();
DataRow[] resultSet = sourceTable.Select(filter.ToString());