Last active
July 20, 2020 10:23
-
-
Save vrySantosh/e3f40bfab44cc8422c2bd75b675ec5d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StringBuilder errorMessages = new StringBuilder(); | |
catch (SqlException ex) | |
{ | |
for (int i = 0; i < ex.Errors.Count; i++) | |
{ | |
errorMessages.Append("Index #" + i + "\n" + | |
"Message: " + ex.Errors[i].Message + "\n" + | |
"LineNumber: " + ex.Errors[i].LineNumber + "\n" + | |
"Source: " + ex.Errors[i].Source + "\n" + | |
"Procedure: " + ex.Errors[i].Procedure + "\n"); | |
} | |
Console.WriteLine(errorMessages.ToString()); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment