2

When I am trying to connect Sybase with c# by using AseClient, I am getting -

{"SQL Anywhere Error -157: Cannot convert '08/10/09' to a timestamp"} System.Exception {Sybase.Data.AseClient.AseException}

I dont know whats the reason

my code is:

var conn = new AseConnection();
conn.ConnectionString =
    "Data Source=myserver:port;" +
    "Initial Catalog=mydb;" +
    "User id=uid;" +
    "Password=pwd;";

conn.Open();

The error i am getting is Cannot convert '08/10/09' to a timestamp I haven't used the date '08/10/09' anywhere..

This is the stacktrace:

=== SQL Anywhere Error -157: Cannot convert '08/10/09' to a timestamp 
    at Sybase.Data.AseClient1.AseConnection.Open() 
    at Sybase.Data.AseClient.AseConnection.Open() 
    at SyBaseTest.Program.Main(String[] args) 
in D:\DotNet\RandD\SyBaseTest\Progr am.cs:line 60

See the Image to get the ISSUE

Dirk Vollmar
  • 172,527
  • 53
  • 255
  • 316
  • 1
    Please post a [mcve] that you've verified exhibits the problem, this to ensure *you* can reproduce the problem with just the connection code. – Lasse V. Karlsen Dec 02 '16 at 11:03
  • 2
    Can you share the stacktrace of the exception? – Dirk Vollmar Dec 02 '16 at 11:03
  • 2
    I highly doubt that just opening the connection throws you that exception. Check your code – Pikoh Dec 02 '16 at 11:04
  • Stacktrace : === SQL Anywhere Error -157: Cannot convert '08/10/09' to a timestamp at Sybase.Data.AseClient1.AseConnection.Open() at Sybase.Data.AseClient.AseConnection.Open() at SyBaseTest.Program.Main(String[] args) in D:\DotNet\RandD\SyBaseTest\Progr am.cs:line 60 – suru santosh kumar Dec 02 '16 at 11:13
  • Have a look [here](https://archive.sap.com/discussions/thread/3646147).It may be related to your problem – Pikoh Dec 02 '16 at 11:35

1 Answers1

0

Problem with the Sybase DLL, Once changed the DLL and changed the Project version to 32bit, its working