Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

Update with $ sign

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David C - 30 Apr 2008 21:18 GMT
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
Mark Fitzpatrick - 30 Apr 2008 22:13 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.