471,092 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

Reading ex.StackTrace as a string with no control characters

Hi:

I'm writing an error handling system for my vb.net windows application. I
have an error trapping routine that is catching all unexpected errors,
writing an entry in an sql database and terminating the program. This is
the best error handling for this program as its printing a bunch of form
letters and should something go wrong there is nothing the user can do to
fix it - I need to get the error message.

My problem is that I can't save the value ex.StackTrace in an SQL database
in a varchar type field.

The value displays quite nicely in a message box however there are control
characters that prevent my stored procedure from writing the values so
nothing gets written. (And I know that the class lib & stored proc work
since I can pass text such as "this is my message" and it gets written).

I have tried ex.StackTrace.tostring and I have the same problem.

I have tried stringbuilder and unfortunately it passes the control
characters to the resultant string.

Does anyone know how to convert ex.StackTract to a string with no control
characters to it can be saved in a varchar field.

Your help would be greatly appreciated!

Fred
Nov 21 '05 #1
1 1947
Update:

The problem was with the vb.net SQL explorer. When I used the enterprize
manager I found all my info had been written!

Very Strange - But: It Works!

Thanks to those who looked at this one for me!

Fred
"Fred Nelson" <fr**@smartybird.com> wrote in message
news:u8*************@TK2MSFTNGP15.phx.gbl...
Hi:

I'm writing an error handling system for my vb.net windows application. I
have an error trapping routine that is catching all unexpected errors,
writing an entry in an sql database and terminating the program. This is
the best error handling for this program as its printing a bunch of form
letters and should something go wrong there is nothing the user can do to
fix it - I need to get the error message.

My problem is that I can't save the value ex.StackTrace in an SQL database
in a varchar type field.

The value displays quite nicely in a message box however there are control
characters that prevent my stored procedure from writing the values so
nothing gets written. (And I know that the class lib & stored proc work
since I can pass text such as "this is my message" and it gets written).

I have tried ex.StackTrace.tostring and I have the same problem.

I have tried stringbuilder and unfortunately it passes the control
characters to the resultant string.

Does anyone know how to convert ex.StackTract to a string with no control
characters to it can be saved in a varchar field.

Your help would be greatly appreciated!

Fred

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by muser | last post: by
1 post views Thread by mail2atulmehta | last post: by
6 posts views Thread by Neil Patel | last post: by
4 posts views Thread by Barry Mossman | last post: by
18 posts views Thread by John | last post: by
11 posts views Thread by Freddy Coal | last post: by
6 posts views Thread by efrenba | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.