I have a code that looks like this:
try
{
Consolidated = Utility.NullConvert.ToBool(dr[Constants.Data.Columns.cConsolidated], false);
}
catch (IndexOutOfRangeException) { }
I do not know if a consolidated column will be present in the datareader, so I do this for verification. It works great (a bit hacky).
When I attach a debugger, it breaks into this when it throws an exception. Extremely annoying.
Is there a better way to write this code; or is there some kind of Visual Studio method telling it to ignore the exception and not interrupt (but only right here, and not everywhere).
source
share