Is there a way to handle exceptions for QueryTools.ExecuteQuery. I have a SQL statement that is having errors which I know I can fix but I would like my program to handle an exception when the function fails. When I run the below code the query fails and crashes the program because of column values which change without warning and I would like to have it handled instead of crashing/breaking.
FileGeoDatabaseFeatureLayer Layer = Overlay.Layers[0] as FileGeoDatabaseFeatureLayer;
Layer.Open();
try
{
SearchResults = Layer.QueryTools.ExecuteQuery(sbSQL.ToString());
}
catch
{
// failed search
}
Layer.Close();