使用 .Net 连接到 Sybase 数据库时出现异常“无法将‘08/10/09’转换为时间戳" [英] Getting Exception 'Cannot convert '08/10/09' to a timestamp' while connecting to Sybase Database with .Net

查看:45
本文介绍了使用 .Net 连接到 Sybase 数据库时出现异常“无法将‘08/10/09’转换为时间戳"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用 AseClient 将 Sybase 与 c# 连接时,我得到 -

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

{"SQL Anywhere 错误 -157:无法将 '08/10/09' 转换为时间戳"} System.Exception {Sybase.Data.AseClient.AseException}

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

不知道是什么原因

我的代码是:

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

conn.Open();

我得到的错误是无法将08/10/09"转换为时间戳我没有在任何地方使用过日期08/10/09"..

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

这是堆栈跟踪:

=== 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

推荐答案

Sybase DLL 的问题,一旦更改了 DLL 并将项目版本更改为 32 位,它的工作

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

这篇关于使用 .Net 连接到 Sybase 数据库时出现异常“无法将‘08/10/09’转换为时间戳"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆