SQL Anywhere Error -157: Cannot convert '08/10/09' to a timestamp

Viewed 2327

This same question has been asked here: Getting Exception 'Cannot convert '08/10/09' to a timestamp' while connecting to Sybase Database with .Net

No answer has been provided and I am unable to post comments to that thread as I am a newer user so I am attempting to ask again.

I am attempting to build a .NET app to talk to a Sybase / ASE / SQL Anywhere database, using the information found at SAP here: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.sdk_12.5.1.adonet/html/adonet/Connecting_adodotnet_development.htm

With that all said, here is the code I am using:

private void MainWindow_Load(object sender, EventArgs e) {
        using (AseConnection con = new AseConnection("Provider=ASEOLEDB.1; Data Source=localhost; Port=2638; Database={correct db name}; Uid={correct username}; Pwd={correct password}; Charset=iso_1;")) {
            con.Open();
        }
    }

I get an exception thrown on con.Open():

"SQL Anywhere Error -157: Cannot convert '08/10/09' to a timestamp"

Stack Trace is as follows:

   at Sybase.Data.AseClient1.AseConnection.Open()
   at Sybase.Data.AseClient.AseConnection.Open()
   at ReportGenerator.MainWindow.MainWindow_Load(Object sender, EventArgs e) 
   in C:\Projects\DiCello\ReportGenerator\ReportGenerator\MainWindow.cs:line 21
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I have seen the following: https://archive.sap.com/discussions/thread/3646147, however this is not applicable as I am not attempting to run a query, I can not yet establish the connection to run the suggested query. The date 8/10/09 is not a date I have submitted anywhere. Also note this exception is on AseConnection.Open(), I have not submitted an ill formatted date, nor does the ill formatted date exist within the database.

1 Answers
Related