473,513 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Dump Data Causing FormatException?

When I catch a System.FormatException, the most information it gives
me is:

"The string was not recognized as a valid DateTime."

What is "the string" (i.e., its value)?

How can I find out, programmatically within the catch block, what the
actual value of the string is?

P.S. I've tried to dump out the MethodBase TargetSite of the exception
but did not (yet) find the data causing the exception.

Thanks.

Jun 25 '07 #1
3 1429
One additional piece of information:

When I do dump out the MethodBase TargetSite, I can get the input
parameters of the Parse() function, especially the first paremeter,
"string s". I tried to get the actual value of the parameter "s"
passed into this Parse() function, but have not yet been successful.

Do you think that this approach will eventually yield the value of the
bad data, or is there some totally different approach?

Thanks.

Jun 25 '07 #2
There really isn't any way to do that. You have to be aware of where
the exception was thrown, and the string that was passed to whatever method
threw it.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<sa**********@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
When I catch a System.FormatException, the most information it gives
me is:

"The string was not recognized as a valid DateTime."

What is "the string" (i.e., its value)?

How can I find out, programmatically within the catch block, what the
actual value of the string is?

P.S. I've tried to dump out the MethodBase TargetSite of the exception
but did not (yet) find the data causing the exception.

Thanks.

Jun 25 '07 #3
No, it won't, as the MethodInfo (and ParameterInfo instances) only tell
you about the structure of the method, they don't actually have access to
any of the data of the method when it is running (since any thread at any
time can run the method, how would you be able to get it from a single entry
point?).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<sa**********@gmail.comwrote in message
news:11**********************@n60g2000hse.googlegr oups.com...
One additional piece of information:

When I do dump out the MethodBase TargetSite, I can get the input
parameters of the Parse() function, especially the first paremeter,
"string s". I tried to get the actual value of the parameter "s"
passed into this Parse() function, but have not yet been successful.

Do you think that this approach will eventually yield the value of the
bad data, or is there some totally different approach?

Thanks.

Jun 25 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6785
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
4
1780
by: Xaver Hinterhuber | last post by:
Hello pythonistas, I build a function with the following code segment: codeObject = new.code( 0, # argcount 0, # nlocals 0, # stacksize 0, # flags codeString, # code
1
1471
by: camelweb | last post by:
Hi, There doesn't seem to be a usenet group for Mono programming, so I thought I'd post my question here. In Visual Studio I set the data formatting expression for one of my DataGrid columns...
7
2037
by: Cyril VELTER | last post by:
I'm trying to dump a database from a 7.1.3 server to a 7.4.2 one. It doesn't works because of difference in COPY format (unless I use -d which is VERY slow on a 16G database). What are the...
10
584
by: John Liu | last post by:
We upgraded from 7.2 to 7.4, it looks like everything working, but when I issue a query such as select * from tab (tab has about 2-3 million records), it causes core dump. I tuned some the...
2
1800
by: Oleg | last post by:
Dear All, I have upgraded Postgresql from 7.3 to 7.4. Starting pg brings error: The database is in an older format that cannot be read by version 7.4 of PostgreSQL dpkg-upgrade postgresql...
8
3005
by: nkrisraj | last post by:
Hi, I have a following structure: typedef struct { RateData rdr; int RateID; char RateBalance; } RateInfo;
1
3697
by: TYR | last post by:
I have a large dump file that originated in a MySQL db; I need to get it into an SQLite file. Various options are suggested around the web; none of them seem to work (most failing to import the...
1
1695
by: =?Utf-8?B?d29vZiE=?= | last post by:
My laptop is generating a memory dump and crashing. With some investigation It led me to believe there was a memory problem (used memtest86+). Changed hard drive, swapped the two 512mb RAMS...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7539
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
7525
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...
1
5089
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3234
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.