Visual Basic and SQL Server
Posted: Sat 14 Aug, 2010 12.14
Before I detail my problem is detail, does anyone have much experience with Visual Basic (Studio 2010) and SQL Server?
I am building an application for work, using my limited experience of Visual Basic. This consists of a two day course on VBA (which brought the idea of the project to mind), the Internet and a book or two.
I have now reached the stage where I need a user to record a number of dates into a SQL Server database. In the application the user uses a DateTimePicker to select the date - presses a button and the database is updated. When they then search for that entry the date is sometimes returned incorrectly.
An example is: the user selects 12 August 2010. SQL records this as 2010-08-12 00:00:00 but the application when fed it back interprets it as 08 December 2010. I now realise that I need to either format my data being recorded into SQL, format the data returned by SQL, or both but am not sure how to do this.
Anyone able to help?
I am building an application for work, using my limited experience of Visual Basic. This consists of a two day course on VBA (which brought the idea of the project to mind), the Internet and a book or two.
I have now reached the stage where I need a user to record a number of dates into a SQL Server database. In the application the user uses a DateTimePicker to select the date - presses a button and the database is updated. When they then search for that entry the date is sometimes returned incorrectly.
An example is: the user selects 12 August 2010. SQL records this as 2010-08-12 00:00:00 but the application when fed it back interprets it as 08 December 2010. I now realise that I need to either format my data being recorded into SQL, format the data returned by SQL, or both but am not sure how to do this.
Anyone able to help?