- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这里也有人问过同样的问题:Getting Exception 'Cannot convert '08/10/09' to a timestamp' while connecting to Sybase Database with .Net
由于我是新用户,因此没有提供任何答案,我无法对该主题发表评论,所以我想再次提问。
我正在尝试构建一个 .NET 应用程序来与 Sybase/ASE/SQL Anywhere 数据库对话,使用在 SAP 此处找到的信息:http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.sdk_12.5.1.adonet/html/adonet/Connecting_adodotnet_development.htm
综上所述,这是我使用的代码:
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();
}
}
我在 con.Open() 上抛出异常:
“SQL Anywhere 错误 -157:无法将‘08/10/09’转换为时间戳”
堆栈轨迹如下:
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)
我看到了以下内容:https://archive.sap.com/discussions/thread/3646147 ,但是这不适用,因为我没有尝试运行查询,我还不能建立连接来运行建议的查询。日期 8/10/09 不是我在任何地方提交的日期。另请注意,此异常发生在 AseConnection.Open() 上,我没有提交格式错误的日期,数据库中也不存在格式错误的日期。
最佳答案
您似乎尝试将日期 (MMDDYYYY) 数据类型应用到 DateTime 或 Time 数据类型。这些本质上是不同的数据类型,包含不同的信息。
时间:
日期:
关于c# - SQL Anywhere 错误 -157 : Cannot convert '08/10/09' to a timestamp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44311789/
我有一个在 sql anywhere 5.5 中创建的数据库文件,我需要它连接到 sql anywhere 12。我试过了,但它不接受,说: "This database was created on
这个问题已经有答案了: How do I make a python script executable? (5 个回答) 去年关闭。 假设我有一个 super 简单的 Python 文件,例如: p
这个问题已经有答案了: How do I make a python script executable? (5 个回答) 去年关闭。 假设我有一个 super 简单的 Python 文件,例如: p
我正在尝试使用 SQL Anywhere 11 从数据库中获取每个表的表大小。 我才发现 sp_spaceused已被弃用 对此的任何帮助将不胜感激! :) 最佳答案 系统 View SYSTAB 可
谁能告诉我如何列出 SQL Anywhere 数据库中的所有外键? 最佳答案 查看 SYS.SYSFOREIGNKEYS 系统表。它列出了主表、外表、外键名称和涉及的列。 披露:我在 SAP 从事 S
我有一个创建预定事件的 SQL 脚本: CREATE EVENT "Daily_1200PM" SCHEDULE "Daily_1200PM" START TIME '12:00' EVERY 24
qlabel 中的自动换行模式仅适用于空格,但如果单个单词足够长,则会被剪切。 为了克服这个问题,我们可以使用 QTextEdit,它在任何地方都提供自动换行功能,但是 QTextEdit 中没有垂直
我有一个创建预定事件的 SQL 脚本: CREATE EVENT "Daily_1200PM" SCHEDULE "Daily_1200PM" START TIME '12:00' EVERY 24
如何在 SQL Anywhere 上查看表的长度(以字节为单位)?这是可能的? 谢谢 最佳答案 要查找表中数据占用的字节数: select db_property('pagesize')*(stab.
如何在设备屏幕上的可编辑文本框中显示多行文本?目前,如果文本不可编辑,那么它会以多行显示全文。相同的值显示在 2 个文本框中,一个是可编辑的,一个是不可编辑的。 例
我刚刚下载了 SQL Anywhere 的开发人员版本。如何获取我所连接的数据库中的表列表?同样对于特定表,我如何获取该表的元数据(列名、类型等)? 最佳答案 我已经很多年没有使用过 SQL-Anyw
我有一个 SQL Anywhere 9 数据库,我想将其中一个列的自动增量值重置为特定数字。 我想我需要 SQL-Anywhere 等价于: ALTER TABLE foo AUTO_INCREMEN
是否有任何好的数据库模式比较工具支持 Sybase SQL Anywhere 版本 10?我见过一连串用于 SQL Server 的,一些用于 MySQL 和 Oracle,但没有任何东西正确支持 S
我想编写一个 SQL IF 语句来检查本地临时表是否存在,但此类表没有记录在 SQL Anywhere 系统目录中。 最佳答案 请注意,您可以在 11.0.1 及更高版本中执行此操作: DROP TA
我正在开展一个学校项目,我必须连接到在 SQL Anywhere 17 中完成的数据库,但我不断收到以下错误: No suitable driver found for jdbc:sqlanywher
我们的应用程序加载 jQuery 1.10.2,然后加载 https://appcenter.intuit.com/Content/IA/intuit.ipp.anywhere.js来自直觉。任意位置
阅读一些 C++ 代码时,我遇到了我称之为函数宏的“功能性”使用,大致如下(这是一个完全程式化的例子来说明这一点): #define TOP_LEVEL(ARG1) \ ARG1("foo1"
我有一个 Python3 脚本,它可以采用脚本通过 sys.argv 读取的可选命令行参数。如果我从终端窗口运行我的脚本,它就可以正常工作,但是每当我将它添加到带有参数的 PA 计划选项卡时,我都会在
我在渲染事件的 app.xml 中的列表控件上调用 eventHandler。eventHandler 正确调用该方法。我想根据标志值使列表只读。 readOnly : function(eventC
我正在尝试连接到外部服务器上的 SQL Anywhere 数据库。我正在使用 VPS Linux。 正在关注 documentation当我运行命令 ./bin32/sa_config.sh 时出现此
我是一名优秀的程序员,十分优秀!