Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Money in sql server 2000 with ASP.NET 2.0

Posted on 2006-03-29
2
Medium Priority
?
608 Views
Last Modified: 2008-03-17
I have a table with a field of type money.
This field gets its currency according to the culture and I format
It in a formview to show the currency symbol:
<asp:TextBox ID="AmountTextBox" runat="server" Text='<%# Bind("Amount", "{0:C}") %>'></asp:TextBox>
When I update this field I get an error:
Input string was not in a correct format.
I update with the following command:

UPDATE Candidate SET Amount = CONVERT (money, @Amount)  WHERE (Candidate_id = @Candidate_id)

If I run the following script in sql query analyzer with a value of $300 it run and update OK. If I put it into a stored procedure and run it - its OK
If I run the store procedure with open in sql query analyzer it gives an error:
Invalid value..
What is the problem here?
0
Comment
Question by:ANAT2403
1 Comment
 

Accepted Solution

by:
ANAT2403 earned 0 total points
ID: 16332424
I found the solution to remove the currency symbol before the updating with the parsing command:
       Decimal tempdec = Decimal.Parse(temp22.Text, System.Globalization.NumberStyles.Currency);
I I had $300 I now have 300.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Screencast - Getting to Know the Pipeline
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question