473,499 Members | 1,589 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2600
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
4039
by: Miranda | last post by:
Hi, I have a ASP/vbscript program that generates random passwords. The problem is I need to insert those passwords into an Access database of 327 clients. I have the random password program...
3
2173
by: Artek | last post by:
Hello, after installing .net 1.1, ASP.NET works fine, but there is a problems with extra zeros added to the numbers at the end. In Sql 2000 SP3a there is for example a table with one column ...
5
2176
by: hfk0 | last post by:
Hi, I'm new to ASP.net, SQL Server and visual studio.net, and I'm having problem inserting and storing data from a web form to a SQL database. I created a simple ASP.NET web form, a simple SQL...
2
4707
by: clinttoris | last post by:
Hello, If someone could help me it would be appreciated as I am not having much luck. I'm struggling with my asp code and have some questions relating to asp and oracle database. First...
0
2498
by: Sam | last post by:
I am trying to use a Simple form with 3 fields from SQL NorthWind Database (Order Details Table with 3 Fields. - OrderId, ProductId and Unit Price). The Field Unit Price has a data type of 'Money...
0
2943
by: Sam | last post by:
Folks.. I am trying to use a Simple form with 3 fields from SQL NorthWind Database (Order Details Table with 3 Fields. - OrderId, ProductId and Unit Price). The Field Unit Price has a data...
5
2008
by: bob44 | last post by:
Hi, I recently created a mysql database using phpmyadmin. I then proceeded to make a form to insert data into the database, but the problem is that the form is only able to insert one record, and...
18
2755
by: boss1 | last post by:
Hi all, i m having a problem with inserting data in oracle db. When i use form action =(call self page) then data is inserting properly.But problem with when using form...
2
3056
by: AlexanderDeLarge | last post by:
Hi! I got a problem that's driving me crazy and I'm desperately in need of help. I'll explain my scenario: I'm doing a database driven site for a band, I got these tables for their discography...
0
7132
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
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7178
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
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6899
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...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4602
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.