473,388 Members | 1,405 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,388 software developers and data experts.

System.Currency inaccessible

Hi,

I have a seemingly easy problem drivin' me nuts. I'd be grateful for any
hint on what may be causing it.
The fact is I'm developing an ASP.NET web site.
At some point, I need to read a money amount from a DataReader. The line is:

if (reader.Read())
{
Currency c1 = (Currency) reader[0]; // OFFENDING LINE
txtAmount.Text = c1.ToString();
// ...
}

The compiler complains that 'System.Currency is inaccessible due to its
protection level'.
If I remove this line and the one below, source compiles fine.

Txs and regards - Octavio


Apr 12 '06 #1
2 4217
Octavio Hernandez <oc*****************@gmail.com> wrote:
I have a seemingly easy problem drivin' me nuts. I'd be grateful for any
hint on what may be causing it.
The fact is I'm developing an ASP.NET web site.
At some point, I need to read a money amount from a DataReader. The line is:

if (reader.Read())
{
Currency c1 = (Currency) reader[0]; // OFFENDING LINE
txtAmount.Text = c1.ToString();
// ...
}

The compiler complains that 'System.Currency is inaccessible due to its
protection level'.
If I remove this line and the one below, source compiles fine.


System.Currency is a class internal to mscorlib - you can't use it.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 12 '06 #2
Thanks Jon!

Just after posting I realized what I wanted was no Currency, but Decimal.
The Delphi past betrays me sometimes :-)

Regards - Octavio

"Jon Skeet [C# MVP]" <sk***@pobox.com> escribió en el mensaje
news:MP************************@msnews.microsoft.c om...
Octavio Hernandez <oc*****************@gmail.com> wrote:
I have a seemingly easy problem drivin' me nuts. I'd be grateful for any
hint on what may be causing it.
The fact is I'm developing an ASP.NET web site.
At some point, I need to read a money amount from a DataReader. The line
is:

if (reader.Read())
{
Currency c1 = (Currency) reader[0]; // OFFENDING LINE
txtAmount.Text = c1.ToString();
// ...
}

The compiler complains that 'System.Currency is inaccessible due to its
protection level'.
If I remove this line and the one below, source compiles fine.


System.Currency is a class internal to mscorlib - you can't use it.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Apr 12 '06 #3

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

Similar topics

2
by: Willing 2 Learn | last post by:
I'm still having trouble getting my program to do arithmetic in cents(keeping all #'s) then convert the answer in a format of dollars & cents. The main program should add, subtract, scalar...
3
by: Dalan | last post by:
Is there any code available to address currency rounding problems in Access 97? Apparently, selecting currency type table fields does not resolve the problem. For instance, in my form I have a...
1
by: Thomas Barnet-Lamb | last post by:
I was wondering if anyone could give me some help with the following. Consider the code snippet: struct qqq{typedef qqq* pointer;}; template<class al> struct foo : public al { template...
18
by: Atara | last post by:
In my apllication I use the following code: '-- My Code: Public Shared Function strDate2Date(ByVal strDate As String) As System.DateTime Dim isOk As Boolean = False If (strDate Is Nothing)...
7
by: Fir5tSight | last post by:
Hi All, I used the following code in C#: using System.Drawing; //blah blah blah Bitmap bmp = new Bitmap();
5
by: Jerry J | last post by:
I want to use the System.Drawing.Image class. According to the help file, this is an abstract base class. Because it is supposedly abstract, I created another class that inherits from it. However,...
16
by: xjohnx | last post by:
Hi, I'm hoping someone can help me I am quite new to Javascript and have had to create a programme which converts dollars into euros and vice versa, here is my script which is working var...
2
by: mr t | last post by:
I have a website set up this way... http://localhost <- project root. http://localhost/Files <- vir dir (not application. just vir dir) with write permissions. 1. Start VS.NET 2005 debugging....
6
by: Paul Herber | last post by:
I'm using the code below to retrieve price data from my e-commerce provider. The plan being to only have prices stored in one location and for there to be correct real-time currency conversions....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.