|
-
Sep 28th, 2004, 08:50 AM
#1
Thread Starter
Member
Net and MS-SQL handling of Date and Time
I am trying out using Net with MS-SQL and using the standard SQL connection. I am still not sure how DATETIME parameters are best handled when passing data to and from MS-SQL.
From my intial test it seems that as long as I pass DateTIME date as parameter values MS-SQL will correctly interprete these without any special handling routines even if the Client and the Server have different regional settings.
Can anybody guide on the best way to handle this.
-
Sep 28th, 2004, 08:57 AM
#2
when I wanted to save a date/time to my SQLServer from .NET, I simply formatted the value myself before the insert to the DB
VB Code:
Dim MyDate as Date
Dim MyDateString as String
MyDate = somedate, regional format doesnt matter
MyDateString = MyDate.ToString.Format("mm/dd/yyyy hh:MM:ss AMPM")
-
Sep 28th, 2004, 11:40 AM
#3
Thread Starter
Member
I did a test, my server is set to UK. I set my client PC to UK and updated a date field on the server. Changed the regional settings on the client PC to US and read back the date from the server and this was read without any problems.
Do not know whether the SQL driver for net is doing all the work in the background. Wish to have somebody clarify this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|