Manage exceptions when selecting, modifying data
catch (SqlException e)
{
switch (e.Number)
{
case 2601: // duplicate error
// Do something.
break;
default:
throw;
}
}PreviousHandle and diagnose database connection exceptionsNextBuild command objects and query data from data sources
Last updated