11/22/2024 4:50:13 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss using the SalesLogix OLE DB Provider from external applications (including usage of built-in provider procedures). View the code of conduct for posting guidelines.
|
|
|
|
DST problem with SLX OleDb Provider
Posted: 25 Oct 08 4:16 PM
|
We are having a very strange problem with the OleDb provider. It seems to not be adjusting for DSt correctly. Here's a code snippet:
System.Data.OleDb.OleDbCommand oleDbCommand = new System.Data.OleDb.OleDbCommand("INSERT INTO C_TIME_TEST (C_TIME_TESTID, DateTimeField) VALUES (?, ?)", connection); DateTime value = DateTime.Now; //value = new DateTime(value.Year, value.Month, value.Day, value.Hour, value.Minute, value.Second); oleDbCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter("@TestId", System.Data.OleDb.OleDbType.VarChar, TestId.Length, "C_TIME_TESTID")).Value = TestId; oleDbCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter("@DateTimeField", System.Data.OleDb.OleDbType.DBTimeStamp, 8, "DateTimeField")).Value = value;
oleDbCommand.Connection.Open(); try { oleDbCommand.ExecuteNonQuery(); } catch (Exception exc) { response.Writeline(exc.Message); } finally { oleDbCommand.Connection.Close(); }
Pretty simple. Here's what I am seeing: 1. the date is being shifted incorrectly. If 'Adjust for DST' is set on the computer then dates before Nov.2 are shifted forward one hour. If 'Adjust for DST' is not set then the dates are fine 2. if I create the date manually from DateTime.now everything works. See commented code above.
It really seems that there is a bug in the SLX OleDb provider. Any advice?
Dave |
|
|
| |
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|