判断是否=OracleType.OracleDateType

解决方案 »

  1.   

    http://msdn.microsoft.com/zh-cn/library/system.data.oracleclient.oracletype(v=vs.100).aspxOracleType.DateTime
      

  2.   

    读取出来fill进datatable里,如果datatable里的列是DateTime类型,那么数据库里就一定是Date类型
      

  3.   

    多谢各位指点,后来这么写就可以了
           string sql = string.Empty;
                    sql = string.Format("select {0} from xxb where rownum<2", col);
                    using (OracleConnection cn = TaiJi.CRJ.Server.Common.ServerCommon.OpenConnection())
                    {
                        DataTable dt = new DataTable("XXB");
                        Oracle.Helper.FillDataTable(cn, System.Data.CommandType.Text, sql, dt);
                        try
                        {
                            DataColumn dc = dt.Columns[col];
                            return (dc.DataType == Type.GetType("System.DateTime")) ? true : false;
                        }
                        catch
                        {
                            return false;
                        }
                    }
      

  4.   

    Type.GetType("System.DateTime")
    这句话完全可以简单的改写为
    typeof(DateTime)