我想这样取oracle的系统时间
string myConnString = "user id=newhis45;datasource=oraback;password=his";
con = new OracleConnection(myConnString);
comm = con.CreateCommand();
con.Open();
this.comm.CommandText = "select sysdate time from dual";
reader = comm.ExecuteReader();
this.textBox1.Text = reader.GetOracleDateTime(0).ToString();可是不行!请问如何做才正确?????

解决方案 »

  1.   

    this.comm.CommandText = "select sysdate from dual";
      

  2.   

    改成这句:this.comm.CommandText = "select sysdate from dual";
    也不行啊,,,我试了,
      

  3.   

    啊,没错,,我忘了reader.read();了,,,,多谢各位!!!!可以结了!应该是这样的:string myConnString = "user id=newhis45;datasource=oraback;password=his";
    con = new OracleConnection(myConnString);
    comm = con.CreateCommand();
    con.Open();
    this.comm.CommandText = "select sysdate time from dual";
    reader = comm.ExecuteReader();
    reader.Read();
    this.textBox1.Text = reader.GetOracleDateTime(0).ToString();