472,782 Members | 1,169 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,782 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 2015
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: muser | last post by:
The following program reads two lines of a file in my A drive and reads no more. Can some sarmartian tell me why that is. Please copy and paste the program into your own compiler please. ...
1
by: mail2atulmehta | last post by:
Hi, I do not know if this is right place for this, but i need some help. I have a text file, whose values are seprated by a delimiter. I want to open this file in excel, ( not import it) . I have...
6
by: Neil Patel | last post by:
I have a log file that puts the most recent record at the bottom of the file. Each line is delimited by a \r\n Does anyone know how to seek to the end of the file and start reading backwards?
4
by: Barry Mossman | last post by:
Hi, I am throwing an exception derived from ApplicationException as follows catch (Exception ex) { throw new MyException("message", ex); } My exception's constructor is: public...
7
by: Drew Berkemeyer | last post by:
Hello, I'm using the following code to read a text file in VB.NET. Dim sr As StreamReader = File.OpenText(strFilePath) Dim input As String = sr.ReadLine() While Not input Is Nothing...
18
by: John | last post by:
Hi, I'm a beginner is using C# and .net. I have big legacy files that stores various values (ints, bytes, strings) and want to read them into a C# programme so that I can store them in a...
11
by: Freddy Coal | last post by:
Hi, I'm trying to read a binary file of 2411 Bytes, I would like load all the file in a String. I make this function for make that: '-------------------------- Public Shared Function...
6
by: efrenba | last post by:
Hi, I came from delphi world and now I'm doing my first steps in C++. I'm using C++builder because its ide is like delphi although I'm trying to avoid the vcl. I need to insert new features...
2
by: ericstein81 | last post by:
Hey all, I have a program that is saving information into and XML file that is later read from to continue the users progress. I am having trouble getting the reader to work without an error ...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.