Home > Database > Mysql Tutorial > Oracle-01861 文字与格式字符串不匹配

Oracle-01861 文字与格式字符串不匹配

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:00:20
Original
1428 people have browsed it

在C#当中编程时候,出现了这种问题。一般都是由于时间格式不对。时间格式一般用变量保存的时候是使用STRING对象,但是用SQL语句录

在C#当中编程时候,出现了这种问题。一般都是由于时间格式不对。

时间格式一般用变量保存的时候是使用STRING对象,

但是用SQL语句录入数据库 的时候就要把STRING对象转换下,通过TO_DATE('STRING','yyyy-mm-dd');

也可以通过调用存储过程来实现,当调用存储过程来实现的时候。就可以不用TO_DATE来转换,,直接把STRING付给相应变量值即可,

如下:

OracleParameter[] paras ={
                            new OracleParameter("date",OracleType.datetime)};

paras[0].Value =MClass.MakeDate;

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template