MySQL problem with C#

iDenTiTy

Expert Member
Joined
Apr 14, 2007
Messages
3,899
Reaction score
2
Location
Fourways (vicinity)
Hi guys,

Here's my problem...

In my application I need to insert values of over R1,3 million into a mySQL database.
What datatype should I use for the table creation? And how do I assign the "R" as a prefix?

So instead of 1300000 -> R 1,300 000 ?

:confused:

:(
 
I don't think that's possible, unless you save it as text as not as an integer. What you can perhaps do is write a class/method that can convert the retrieved data (1300000) to the required string (R1,300 000).
 
I don't think that's possible, unless you save it as text as not as an integer. What you can perhaps do is write a class/method that can convert the retrieved data (1300000) to the required string (R1,300 000).

Ja, I was thinking that.

Thanks. :)

PS.

Mavix for President +1
 
To do it very good:

Store the amount in a column of type double, and have a separate column with a foriegn key to a Currency table. Then get your presentation class to format the number as a currency.
 
data in sql should be stored in their raw format and when read back you manipulate the data.

having another table as Currency and linked to the other table, i haz agree with deenem :)
 
To do it very good:

Store the amount in a column of type double, and have a separate column with a foriegn key to a Currency table. Then get your presentation class to format the number as a currency.

Ja. Thanks. I have already set datatype as double. My DAL class is gonna format it.

Thanks guys.
 
I don't think that's possible, unless you save it as text as not as an integer. What you can perhaps do is write a class/method that can convert the retrieved data (1300000) to the required string (R1,300 000).

Before you re-invent the wheel, look at String.Format(..) and its currency tag. Will save you a couple minutes
 
Top
Sign up to the MyBroadband newsletter
X