日期:2014-05-17  浏览次数:21060 次

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);
                    }
                }
            }
        }

------解决方案--------------------
遇到同样的问题   无法解决