473,594 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Conversion from string "0.175" to type 'Decimal' is not valid.

2 New Member
Hi,

I'm getting this error intermitantly in a custom configuration section in my ASP.NET website.

From what I can see 0.175 is a valid string to be converted to a decimal! And most of the time it works, so why is it that about once a week for about half an hour I get this error? Any Ideas?

Thanks,
Ady

Expand|Select|Wrap|Line Numbers
  1. System.InvalidCastException: Conversion from string "0.175" to type 'Decimal' is not valid.
  2.    at Microsoft.VisualBasic.CompilerServices.Conversions.ToDecimal(String Value, NumberFormatInfo NumberFormat)
  3.    at Microsoft.VisualBasic.CompilerServices.Conversions.ToDecimal(String Value)
  4.    at Paperheads.CMS.Configuration.Location..ctor(XmlNode Node, Configuration Config)
  5.  
Jan 24 '07 #1
3 5021
radcaesar
759 Recognized Expert Contributor
There will be another discussion regarding this InvalidCastExce ption in this community itself.

http://www.thescripts. com/forum/thread156167.ht ml

Have a look

:)
Jan 24 '07 #2
Ady1
2 New Member
Hi radcaesar,

Although the poster does experience the same error, the resolution in the topic appears to indicate that there is a problem with the code.

When I catch the exception, I try the following code:

Dim dValue As Decimal = CDec("0.175")

And it still generates the same exception!

Thanks,
Ady
Jan 24 '07 #3
FrankieBakerJr
6 New Member
Hello Ady1
Did you ever get your issue resolved? I'm having the same problem. Simply


Dim strString As String = "0"

Both of the lines below generate the error Conversion from string "0" to type 'Long' is not valid
=============== =====
Dim lngLong As Long = strString
Dim lngLong As Long = CLng(strString)
Feb 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1399
by: David P. Donahue | last post by:
I'm using C# to create an ASP .NET website backed by a MySQL database. One of the things I do often on the site is populate a DataList by binding it to a DataSet pulled from the database. However, I'm running into a bit of a problem with a specific field type in the database. It seems that fields of type TEXT (a kind of binary way of storing large amounts of text) generate the error "Unknown Target Conversion Type" when I try to bind...
9
12538
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! Is it possible to alter the string type? Basicly what i want to do is to create my own string type. lets call it sqlString, when i use this it will always use replace on the string assigned... Instead of using:
2
1776
by: zhengfish | last post by:
HI,all I have a class named CCC which have some members of std::string type. I declare a class pointer like this: CCC* ccc = new CCC( xml_input ); then I send the ccc to another module with msg_queue. then this lead to a error on win32 platform, but it's works well on Redhat Linux 9.0. what's the reason?
3
1596
by: Alex K. | last post by:
Hi all I need a string type with only three possible values: let's say "A", "B", "C". In other words, I need something like enum but of string type: enum MyStrings { sA = "A", sB = "B", sC = "C"
4
1304
by: thomas.pohl | last post by:
Hi, let's assume you want to nicely print the content of a list except for one (or some) individual item. You could do it like this: t = print("text: %s\nvalues: %i %i %i" % (t, t, t, t)) If there was a conversion type which simply ignores the corresponding list item
1
8011
by: Mike | last post by:
Hi, I'm passing a JSON-encoded string to json_decode() and am expecting its output to be an object type, but am getting a string type instead. How can I return an object? In the docs, the following returns an object: $json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; var_dump(json_decode($json));
3
3844
by: Mike Howarth | last post by:
Hi Seem to be having a bit of brainfreeze this evening. Basically I'm reducing an array of prices like so: This gives me a string of '86.00.00' which I am trying to use with decimal objects. Python 2.4 is not particularly happy with this. Additionally I can't simply convert the string to a decimal as it would be
1
2786
by: kenneth6 | last post by:
ctype.h: toupper(c), tolower(c): change case of char isalphanum(c), isalpha(c), isdigit(c), ispunct(c), isspace(c), iscntrl(c), islower(c), isupper(c): boolean checks on type of char i know this is for char type. If the data i am using is in string type, how can i use these functions or do the similar tasks with the string type data?
1
2543
by: kenneth6 | last post by:
I am writing sth about data in string type in console mode. now, I transform it to Windows Form Application, i know managed type should be used here instead of the unmanaged type. should I change the unmanaged type of string to char* for better data manipulation??
6
2485
by: SchoolOfLife | last post by:
Does an object in C++ of std::string type terminates with null character? The charater string literals in C++ (to maintain backward compatibility with C) end with a null character. Is this same with an object of std::string type? Thank you...
0
7876
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8372
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8234
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6654
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5739
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5408
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3897
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1478
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1210
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.