all groups > vb.net > may 2004 >
You're in the

vb.net

group:

SQL Database column has 2 decimals - Textbox displays 4????


Re: SQL Database column has 2 decimals - Textbox displays 4???? William Ryan eMVP
5/31/2004 3:28:20 PM
vb.net:
You can set a mask on the control or trap the Format event
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsbindingclassformattopic.asp .
You'll want to trap the inverse too with Parse, but the link above will walk
you through it with a textbox.

--
W.G. Ryan MVP Windows - Embedded

http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
[quoted text, click to view]

SQL Database column has 2 decimals - Textbox displays 4???? Mike
5/31/2004 7:13:04 PM
Hi All;

I have created a MSDE SQL table with a column set to money, format is
standard with 2 decimal places. Into the field I put 12345.67. When
you view the data it shows 12,345.67. When I run the form, fill the
dataset the Textbox shows 12,345.6700.

Do I need to reformat the Textbox after the fill to only show 2
decimal places? If so is there a global setting that can do this or do
I need to do this on all Textbox controls that contain numbers?

AddThis Social Bookmark Button