![]() ![]() Public Sub ShowSqlException(ByVal connectionString As String)ĭim queryString As String = "EXECUTE NonExistantStoredProcedure" "Procedure: " ex.Errors.Procedure "\n") Ĭonsole.WriteLine(errorMessages.ToString()) "LineNumber: " ex.Errors.LineNumber "\n" SqlCommand command = new SqlCommand(queryString, connection) įor (int i = 0 i < ex.Errors.Count i )ĮrrorMessages.Append("Index #" i "\n" ![]() Using (SqlConnection connection = new SqlConnection(connectionString)) StringBuilder errorMessages = new StringBuilder() String queryString = "EXECUTE NonExistantStoredProcedure" ![]() public static void ShowSqlException(string connectionString) The following example generates a SqlException and then displays the exception. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |