Converting user input - SmallMoney type
Hi, all.
I have a slight problem with a data field & need some help on converting data types. I have looked around & cannot find a good, clear explanation of passing data from ASP pages to SQL databases.
Here's what I have:
1. a field in a table called 'CertFees' which is type SmallMoney.
2. a Sproc that passing the value along from the ASP page through the statement '@CertFees SmallMoney'.
3. an ASP page that displays the data in a textbox with the follwing code:
<asp:TextBox id="tbxCertFees" Text='<%# DataBinder.Eval Container.DataItem, "CertFees", "{0:C}") %>' runat="server" />
4. a SQL command of:
Dim objUpParameter19 As New SqlParameter("@CertFees", SqlDbType.SmallMoney)
that sends the data to the Sproc.
The data displays nicely with the format $##.##. & if the user enters a number in decimal format, such as 25.50 or 9, there's no problem. However, it breaks down when the user enters a '$' or any other character info. I know I need to convert the enter data to a SmallMoney type before sending the data to the database, but I'm not sure how.
Any pointers? & if you know of a good source to read about types & SQL/ASP, that would help a lot.
Thanks!
Dave
|