Hi All,
I am getting "An unhandled exception of type 'System.StackOverflowException' occurred in System.Data.dll" in my DataView rowfilter property. I'm not getting any stack trace for that. So can any one help me on that. Please find below the code where i'm getting the error in filterView.
DataSet metalAttributeDS = LoadItemData(); //loads the static dataset
DataTable metalDataTable = metalAttributeDS.Tables["FilterTable"];
DataView metalfilterView = new DataView(metalDataTable);
metalfilterView.ApplyDefaultSort = true;
metalfilterView.RowFilter = queryBuilder +
string.Format(
" And AttributeName='Metal' and AttributeValueID in ({0})",
string.Join(",", AttributeValueID.ToArray())); //forms query condition dynamically.
var res = from DataRowView rowView in metalfilterView select rowView["ItemID"].ToString();
int countParam = 0;
queryBuilder.AppendFormat(" and (");
foreach (string id in res)
{
countParam++;
queryBuilder.AppendFormat(" ItemID = '{0}'", id);
if (res.Count() > countParam)
{
queryBuilder.Append(" Or");
}
}
queryBuilder.Append(" )");
}
DataSet dataSet = LoadItemData(); //loads the static dataset
DataTable dataTable = dataSet.Tables["FilterTable"];
DataView filterView = new DataView(dataTable);
filterView.ApplyDefaultSort = true;
LogHelper.LogInfo(GetType(), "filterView.RowFilter");
filterView.RowFilter = queryBuilder.ToString(); // throws error
Thanks, Mehul Makwana.