Hi Maesto10,
Based on your requirement, I think you could modify your code like below:
try { //Your code } catch(SqlException ex) { MessageBox.Show("there was an issue!"); } catch(Exception ex) { MessageBox.Show("there was another issue!"); }
For more information, please refer to the following links:
SqlException Class: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlexception(v=vs.110).aspx
SqlException.Number Property: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlexception.number.aspx
http://stackoverflow.com/questions/19970397/c-sharp-try-catch-confusion
Best Regards,
Candice Zhou