首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

odp.net 不能更新日期解决办法

2013-06-19 
odp.net 不能更新日期 Oracle 数据库,不能更新日期,更新其它列的数据是没有问题的,语句在Sql Developer 中

odp.net 不能更新日期


 Oracle 数据库,不能更新日期,更新其它列的数据是没有问题的,语句在Sql Developer 中可以执行,
 但在.NET 程序中执行到OracleCommand对象的ExecuteNonQuery() 方法后就没有任何反应,也不报错 。

 语句:
 UPDATE USERS SET LASTACTIVEDATE=to_date('2003/03/03 12:12:12','YYYY/MM/DD HH24:MI:SS')


   public int ExecuteSql(string SQLString)
        {
            using (OracleConnection connection = new OracleConnection(connstring))
            {
                using (OracleCommand cmd = new OracleCommand(SQLString, connection))
                {
                    try
                    {
                        connection.Open();
                        int rows = cmd.ExecuteNonQuery();
                        return rows;
                    }
                    catch (Exception E)
                    {
                        connection.Close();
                        throw new Exception(E.Message);
                    }
                }
            }
        }
[解决办法]
遇到同样的问题   无法解决

热点排行