date format

  • Thread starter Thread starter mike
  • Start date Start date
M

mike

When using the database wizard I found that it does not format the date
properly. It shows the date in the long format. Is there a way to use the
database form wizard and have the date fields formated however one would
like (ie short or long form)? I would also like to format a field for phone
numbers. I am having trouble using the Microsoft Mask control because if I
bind it to the dataset then all the rest of the fields go blank. Do I have
to handle these functions in code? I was thinking of something like calling
a validation function that checks the textbox and returns the corrected
string in a phone or short date format. But is there an easier way?
 
Mike -

Check out the Binding.Format and Binding.Parse events
The Format and Parse events allow you to create custom formats for
displaying data. These links have example code that should help you out.

Binding.Format
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwindowsformsbi
ndingclassformattopic.asp

Binding.Parse
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWindowsFormsBi
ndingClassParseTopic.asp


--
Steve Stein, VB Team
This posting is provided "AS IS" with no warranties, and confers no rights.


From: "mike" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.adonet
Subject: date format
Date: Mon, 14 Jul 2003 04:33:46 GMT

When using the database wizard I found that it does not format the date
properly. It shows the date in the long format. Is there a way to use the
database form wizard and have the date fields formated however one would
like (ie short or long form)? I would also like to format a field for phone
numbers. I am having trouble using the Microsoft Mask control because if I
bind it to the dataset then all the rest of the fields go blank. Do I have
to handle these functions in code? I was thinking of something like calling
a validation function that checks the textbox and returns the corrected
string in a phone or short date format. But is there an easier way?
 
Back
Top