Dave,
>I have a coulpe of questions about using dates in VS2005 and MM.NET. I am building a Web App very similar to the sample Web App in MM that accesses VFP tables.
>
>1. When I load my edit form, all of the fields where the date is empty (blank), display with 12/30/1899. How do I get them to display blank? Once the user puts a date in and the form is saved, they display the entered date correctly.
>
>2. When the user enters a date in my mmTextBox control, how do I compare and vaildate the entry. In VFP, I would use the CTOD() to see if the entry would return a date or ' / / '. How do I do this in VS2005/MM.NET?
>
>3. Finnally, if the user passes a date that is not valid, I would like to display a simple error message. In VFP, I would use the messagebox(). I did find a mmMessageBox function but could not get it to work.
Regarding the empty date question, are you creating a Web Forms application? The reason I ask is because your second question is about MessageBox() and MessageBox is a Windows Forms class, so it doesn't work on the web.
To convert a date from string to DateTime you can do this:
DateTime.Parse(MyDate);
I recommend checking out the Visual FoxPro Toolkit for .NET. Its help file contains a list of Visual FoxPro commands and shows you the equivalent command in .NET.
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com