I have a VB form that displays two text boxes: one defaults to today's date, txtCommentDate, and the other is blank for the user to enter some activity/comment associated with that date, txtComment. They can change the date in txtCommentDate if needed, but it defaults to today's date. They can then click the AddComment button that updates this record to a relational table in SQL server, and re-displays this as a new record in the Comments data grid back on the form.
All worked fine when it was just U.S. users, but I now have Australia and I am having trouble displaying it differently for AUS, for example dd/mm/yy and then getting it into the database as the right date. When I pass this formatted date to SQL, seems no matter what I do it puts it in incorrectly. For example, if the date is displayed as today of 17/10/11, it goes into SQL as 10/11/2017. I've tried re-formatting it as "mm/dd/yy" prior to passing to the SQL call, but this does nothing.
My questions are:
--I want to continue to display it one way for U.S. in the txtCommentDate text box and the other way for Australia. How best to do this?
--When they click AddComment button, I need to pass the value of the txtCommentDate box into SQL Server as the valid date. How do I do this?
--Since the DataGrid has its own properties, how best to display the date as U.S. or AUS in the Data Grid's display of this newly added CommentDate and Comment record.