469,647 Members | 1,778 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

Inserting money type in database from asp.net form!

Hello gurus,

How do i handle Currencies from "asp.net form field " to "insert " querry in
database?

The "money" is entered in a textbox and my code is falling to the stored
procedure due to wrong currency format.

Any help will be higly cheered!

Thanks
JB

Nov 18 '05 #1
3 2374
Hi Jensen,

It depends of how you keep the value internally in your application, if you
need to do some operation or just show it.

If you need to make any operation with the values ( almost for sure ) you
can keep it as a double, then you can show it using double.ToString("C")
which format it to the locale currency format. if you do this you can save
them using SqlDbType.Float.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Jensen bredal" <je***********@mimosa.com> wrote in message
news:eo***************@tk2msftngp13.phx.gbl...
Hello gurus,

How do i handle Currencies from "asp.net form field " to "insert " querry in database?

The "money" is entered in a textbox and my code is falling to the stored
procedure due to wrong currency format.

Any help will be higly cheered!

Thanks
JB


Nov 18 '05 #2

Microsoft recomends the use of the decimal data type in .Net for holding
currency values ( see MSDN )
i use this in all my apps and do not have anny problems

in sql server i store my currency values with the money data type
M. Posseth [MCP]

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:ei**************@TK2MSFTNGP12.phx.gbl...
Hi Jensen,

It depends of how you keep the value internally in your application, if you need to do some operation or just show it.

If you need to make any operation with the values ( almost for sure ) you
can keep it as a double, then you can show it using double.ToString("C")
which format it to the locale currency format. if you do this you can save them using SqlDbType.Float.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Jensen bredal" <je***********@mimosa.com> wrote in message
news:eo***************@tk2msftngp13.phx.gbl...
Hello gurus,

How do i handle Currencies from "asp.net form field " to "insert " querry
in
database?

The "money" is entered in a textbox and my code is falling to the

stored procedure due to wrong currency format.

Any help will be higly cheered!

Thanks
JB



Nov 18 '05 #3
Well the decimal solution , as i have just discoverd is also used in the
Commerce starter kit project. So i guess i ll
use it to .

I have also been tempted by the double "thing" but it always returned
"string has wrong format".

But many thanks to both of you.(IT gods)

J.Bredal

"M. Posseth" <mi*****@nohausystems.nl> wrote in message
news:ca**********@reader10.wxs.nl...

Microsoft recomends the use of the decimal data type in .Net for holding
currency values ( see MSDN )
i use this in all my apps and do not have anny problems

in sql server i store my currency values with the money data type
M. Posseth [MCP]

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:ei**************@TK2MSFTNGP12.phx.gbl...
Hi Jensen,

It depends of how you keep the value internally in your application, if

you
need to do some operation or just show it.

If you need to make any operation with the values ( almost for sure ) you
can keep it as a double, then you can show it using double.ToString("C")
which format it to the locale currency format. if you do this you can

save
them using SqlDbType.Float.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Jensen bredal" <je***********@mimosa.com> wrote in message
news:eo***************@tk2msftngp13.phx.gbl...
Hello gurus,

How do i handle Currencies from "asp.net form field " to "insert "

querry
in
database?

The "money" is entered in a textbox and my code is falling to the

stored procedure due to wrong currency format.

Any help will be higly cheered!

Thanks
JB




Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by bob44 | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.