datetime 類型的值如何傳遞
private const string sql_gcInsert = "insert into gc_outandin(id,idno,outtime,intime,deflag,remark) values (&vid,&vidno,&vouttime,&vintime,&vdeflag,&vremark) ";
public int Insert(gc_outandinInfo gc_outandin)
{
gc_outandin.ID = getMaxid() + 1;
OracleParameter[] parms ={
new OracleParameter(PARM_ID,OracleType.Number),
new OracleParameter(PARM_IDNO,OracleType.VarChar),
new OracleParameter(PARM_OUTTIME,OracleType.DateTime),
new OracleParameter(PARM_INTIME,OracleType.DateTime),
new OracleParameter(PARM_DEFLAG,OracleType.VarChar),
new OracleParameter(PARM_REMARK,OracleType.VarChar)
};
parms[0].Value = gc_outandin.ID;
parms[1].Value = gc_outandin.IDNO;
parms[2].Value = gc_outandin.OUTTIME;
parms[3].Value = gc_outandin.INTIME;
parms[4].Value = gc_outandin.DEFLAG;
parms[5].Value = gc_outandin.REMARK;
int torf = OracleHelper.ExecuteNonQuery(OracleHelper.orclConnectionString, CommandType.Text, sql, parms);
return torf;
}
public static int ExecuteNonQuery(string connectionString, CommandType cmdType, string cmdText, params OracleParameter[] commandParameters) {
// Create a new Oracle command
&