I have an asp.net FormView that is displaying a money field as shown below.
<asp:TextBox ID="txtInitialClaim" runat="server" Text='<%#
Bind("InitialClaim", "{0:c}")%>' Width="120px"></asp:TextBox>
When the update command runs it throws an error because the dollar sign is
in the field. I want the user to be able to enter or view the $ sign. Is
there any way around this to avoid the error? Thanks.
David
Your best bet is to strip it out before you attempt to save it. Keep in
mind, datatypes such as money often don't have the $ actually stored in
there since it's not numeric. In SQL Server, for example, the money datatype
is an 8-byte number, not a textual string so you have to strip out the extra
decorations such as the $.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP- Expression
> I have an asp.net FormView that is displaying a money field as shown
> below.
[quoted text clipped - 7 lines]
>
> David
David C - 30 Apr 2008 22:32 GMT
Thanks. I think I wil use a validator control and force currency. That
seems to work.
David
> Your best bet is to strip it out before you attempt to save it. Keep in
> mind, datatypes such as money often don't have the $ actually stored in
[quoted text clipped - 17 lines]
>>
>> David