Money in sql server 2000 with ASP.net 2.0

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?
ANAT2403Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Anthony PerkinsCommented:
Don't rely on the regional settings of the Server and pass a numeric value (without any currency symbol) to the UPDATE statement.
0
Aneesh RetnakaranDatabase AdministratorCommented:
can u check which value is giving error.. also send the exact error message..

Run profiler first, then run your application and find whether the values are passed correctly..

For example if your sp is like this

create spUpdate (@Amount money, @candidate_id int )...


and u call the ps like
exec spUpdate 300.00, 2  --- works well
exec spUpdate '3000.00',2  -- will give u the erro  
0
ANAT2403Author Commented:
comment to acperkins:
I don't want to pass the server the currency symbol but I have it becaule of he definition - "{0:C}"
How do I remove the currency symbol? Shall I do it in the event 'FormView1_ItemUpdated'  ?

comment to aneeshattingal:
I gave all the error messages:   INPUT STRING WAS NOT IN A CORRECT FORMAT
The problem is that I have a field which include a currency symbol and this make me problems in the update.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Anthony PerkinsCommented:
>>but I have it becaule of he definition - "{0:C}"<<
You don't have to.  You simply have not found out how.  {0:C}  is just formatting, try submitting without.  Or even better post in a more appropriate Topic Area such as:
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/
0
ANAT2403Author Commented:
I repeat my question:
How to remove the formatting or how to format without the currency symbol???
0
ANAT2403Author Commented:
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
ANAT2403Author Commented:
OK
0
Anthony PerkinsCommented:
Annie,

It is fine with me.

Anthony
0
Aneesh RetnakaranDatabase AdministratorCommented:
Hi Annie,
It's fine with me too
0
kodiakbearCommented:
Closed, 500 points refunded.
kb
Experts Exchange Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.