473,405 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 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 2049
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.