.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Decimal parsing with letter B

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :.NET Framework
I' m working on receiving quotes from Yahoo quotes provider. Its results for market capitalization of a company usualy include letter B as meaning of a billion. But when I try to use usual decimal.Parse I get an exception. I've looked to the documentation but all the parameters of Parse function have no option to specify that the letter B means billion. Tell me please if some class of .Net Framework provides a tool to parse a decimal with such specifying of millions, billions, etc. with letters.

View Complete Post

More Related Resource Links

Event not raised while parsing xml file



In Visual Studio 2010 ASP.NET 4.0

I want to write a procedure to validate a xml file with a xsd. I found some examples on the web but the one i chose does not work as attended. The example uses XmlReader with a XmlReaderSettings and a ValidationEventHandler.

Here is the code

Protected Sub VerifyDes(ByVal filename As String)

        Dim xslDes As XmlReaderSettings = New XmlReaderSettings()
        xslDes.Schemas.Add("", "http://www.mysite.com/xsd/ValidData.xml")
        xslDes.ValidationType = ValidationType.Schema
        xslDes.ValidationFlags = XmlSchemaValidationFlags.ReportValidationWarnings

        AddHandler xslDes.ValidationEventHandler, AddressOf xslDesValidationEventHandler

        Dim des As XmlReader = XmlReader.Create(filename, xslDes)

        While (des.Read())

        End While

    End Sub

    Protected Sub xslDesValidationEventHandler(ByVal sender As Object, ByVal e As ValidationEventArgs)

        'some code here
    End Sub

I tested this procedure with a xml file which was well formed but contained some elements which were not conform to the xsd.

No event or error occured. It said the file was valid.

Then i tested with a badly formed file. A XmlException was raised but nothing happened with the ValidationEventHandler.

It seems lik

CLR Inside Out: Formatting and Parsing Time Intervals in the .NET Framework 4


Learn about enhanced TimeSpan formatting and parsing features coming in the .NET Framework 4, and some helpful tips for working with TimeSpan values.

Ron Petrusha

MSDN Magazine February 2010

decimal value validation and round off by javascript

The article decimal value validation and round off by javascript was added by hiral.hapani on Wednesday, June 02, 2010.

Hi All, I have createdone javascript by which you canvalidate a decimal value of any textbox for which you want. By thisjavascriptwecan bind user to enter only digits in textbox. and when he will enter any decimal value javascript will do round off it

Which one is better: Money or Decimal?



I want a field to keep money value (up to 100,000,000.00). And I didn't  work with money or decimal data type.

Money data Type is 8 byte

Decimal (9, 2) is 5 byte. (Exactly msdn only say Decimal (9, 0) is 5 byte and I don't really know how byte is Decimal (9, 2))

Please tell me which one is better to work with in sql and VS.net (handling sql in VS)

Best Regards. Morteza

Help parsing a string


Hi Everyone, I have the following string

strFullString = "<img src="http://image.weather.com/web/common/wxicons/31/32.gif?12122006" alt="" />Sunny, and 104 &deg; F. For more details?"  


What I would like to do is parse the full string into two strings with the following values

strImgSource = "http://image.weather.com/web/common/wxicons/31/32.gif"

strWeather = "Sunny, and 104 &deg; F."


Ive been pulling my hair out with this one, any help would be greatly appreciated. Thanks!

Need RegEx for four decimal place

Hello All, I have total 19 digits in which i have 4 decimal place. What would be the pattern. ThanksBizTalk Beginner

How do I get Decimal.Parse to stop taking current culture into account?

How do I get Decimal.Parse to stop taking current culture into account?   I tried the following but I get an error saying “String was not recognized as a valid DateTime.   Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");   Decimal.Parse("5000.000,51",CultureInfo.InvariantCulture)

Parsing WSDL using ServiceDescription

Hi, I am trying to parse a wsdl file using the ServiceDescription class. I've been able to extract some information such as ports and messages. However, I am having trouble accessing the types described in the file. These are the types eclosed within the definitions element. <wsdl:types> <xsd:schema> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/http/"/> <xsd:complexType name="singleOutAddress"> <xsd:sequence> <xsd:element name="ReferenceID" minOccurs="0" maxOccurs="1" type="xsd:string"> </xsd:element> <xsd:element name="AddressID" minOccurs="0" maxOccurs="1" type="xsd:string"> </xsd:element> <xsd:element name="Score" minOccurs="0" maxOccurs="1" type="xsd:string"> </xsd:element> <xsd:element name="Address" minOccurs="0" maxOccurs="1" type="xsd:string"> </xsd:element> <xsd:element name="PostalCode" minOccurs="0" maxOccurs="1" type="xsd:string"> </xsd:element> <xsd:element name="ErrorCode" minOccurs="0" maxOccurs="1" type="xsd:string"> </xsd:element> <

Bianry data to decimal value in sql

Hi all! can any one tell me please if we have data in one column is in binary format i.e  e.g 0111 result should be 7. How should we retrive the decimal value 7 through sql server 

Server ERROR: An error occurred during the parsing of a resource required to service this request.

I have created one asp.net 2.0 application and created a setup project. I run this setup in my local machine, the application run fine, but i uploaded into online server I met the following parser error.How to solve this error? Kindly help me. Very urgent.. Kamal....

Need help parsing out a datestamp

Hi folks, I'm trying to parse a datestamp (that I got from Twitter) but am receiving errors. here's the datestamp: Fri, 27 Aug 2010 22:00:07 +0000 Here's my code: DateTime.ParseExact(MyDateValue, "ddd, dd MMM YYYY HH:mm:ss +ffff", new CultureInfo("en-US")) and here's my error: System.FormatException was unhandled   Message=String was not recognized as a valid DateTime. Anyone fancy taking that on? To make it easy I've provided the code below for a console app that exhibits the problem.   Thanks Jamie using System; using System.Globalization; class Program { static void Main(string[] args) { string MyDateValue = "Fri, 27 Aug 2010 22:00:07 +0000"; var dt = DateTime.ParseExact(MyDateValue, "ddd, dd MMM YYYY HH:mm:ss +ffff", new CultureInfo("en-US")); } } http://sqlblog.com/blogs/jamie_thomson/ | @jamiet | About me

parsing weather channel xml file using linq

 Hi I never used linq before and i'm having trouble parsing the xml file at  http://xoap.weather.com/search/search?where=" + strCityName.ToString(); I used to use a dataset but since trying to change my site to mvc, i thought i would use linq to xml, but after 2 days have still not found success. i have a class called: public class WeatherCityBLLModel { public string loc { get; set; } public string loc_id { get; set; } } and then a class called public class WeatherCityDALModel { public static List<WeatherCityBLLModel> GetLocation(string strCityName) { XDocument doc = XDocument.Load("http://xoap.weather.com/search/search?where=" + strCityName.ToString()) return doc; <<< Does not work } } How do i get the data from xoap.weather and pass it to my controller Any help appreciatedGeorge        

XML Parsing Error: no element found

I had an old SQL server  2008 instance removed and reinstalled SQL server, SSAS, SSRS all together.   When trying to log onto Report Server, I am seeing following error.  can you hel? thanks     XML Parsing Error: no element found Location: http://myservername:8080/Reports/Pages/Folder.aspx Line Number 1, Column 1:

Validate input has up to 2 decimal places

I need to validate hours put into a textbox.  I want to allow hours to be from 0-24 and allow up to 2 decimal places. so it has to accept not 2.225 or 25I put a range validator that check that the value is from 0-24 but it doesn't check that there are 2 decimal places or less.  how do I do that?

Parsing a SQL query

I am trying to parse a SQL select query.  The idea is to pull out the field names in the query to use them in a lookup to get the units for each field.    The problem is that I need to put units on the columns, but do not know in advance which fields are being queried.  People can type in a free hand query using the field names, "as", "sum(field)", "count(field)", etc.    I am new to regular expressions.  Has anyone done anything like this, or could point me to an example that I could use to get started?   Any help would be great.   Thanks.   David

Quick way to widen a decimal column in place?

Hi all, I have a table with over 400 million rows in it, and it turns out that one of the columns that was defined as decimal(14,5) needs to be widened to decimal(18,5).  The column is not used an any keys or indexes. What's the fastest way of doing that?  When I attempt to change the column definition (right-click the table in SSMS, select Design, update the column definition, then attempt to save), SSMS complains, saying Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created.... Thanks, Matthew  

Loading Decimal Number From Excel into SQL Server 2005 using SSIS Package

If you have an excel spreadsheet that displays a number .02 (because it is formated) but internally it is stored as .2654329 and you want to load .2654329 how can you do that in the SSIS package?  When we load the spreadsheet it is loading .02.  Is there some kind of option in the SSIS package to tell the package to load the internal number?lcerni
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend