VB.NET

Moderators: seancampbell
Number of threads: 4020
Number of posts: 10026

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
FormatCurrency Function Posted by Nola on 6 Jun 2008 at 3:07 AM
Hi to All
I want to ask a question about FormatCurrency Function.
When I just write:
FormatCurrency(......)
I got : FormatCurrency is a namespace and can't be used as an expression error.
But when I write:
strings.FormatCurrency(.....)
It runs properly.

I have checked lots of programs using the function directly:
FormatCurrency(......)
and it runs suceessfully.

Can you explain how??

Thanks
Report
Re: FormatCurrency Function Posted by seancampbell on 6 Jun 2008 at 5:47 AM
I had a similar issue with SqlClient.SqlConnection vs System.Data.SqlClient.SqlConnection when I was converting a project from Framework 1.1 to Framework 2.0

I bet that the code you are reading that uses it fine without Strings. was written in a different framework then what you are writing in.

If you want to be able to call FormatCurrency() without Strings. then type Imports Microsoft.VisualBasic.Strings at the top of your code file, (Goes about the Class declaration of the Form or above the Module declartion of a module) and that should clear things up.

----

It appears that the newer versions of the framework import less sets of code, probably to cut down on memory usage. So sometimes things you could call directly in 1.1 need to be called through the proper namespace.

-Sean
Report
Re: FormatCurrency Function Posted by Nola on 6 Jun 2008 at 9:11 AM
I tried your solution but the result is the same.
Any way, I will keep writing strings.FormatCurrency

thanks a lot :)



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.