注意oracle 中的日期就是DataTime 型的我给你个实例子,自己去研究:string Dtstr;
Dtstr = this.InformTimeTB.Text; if(NowIsAddInform)
strSql ="insert into Aided_Comment(Comment_Id,Topic_Comment,Commenter,COMMENT_CONTENT,Comment_time)values('" + this.InformIdTB.Text + "','" + this.InformTitleTB.Text + "','" + this.Informer.Text + "','" + this.InformContentTB.Text + "',to_Date('"+Dtstr+"','yyyy-mm-dd'))";
else
strSql ="update Aided_Comment set Topic_Comment='" + this.InformTitleTB.Text + "',COMMENT_CONTENT='" + this.InformContentTB.Text + "',Commenter='" + this.Informer.Text + "',Comment_time=to_Date('"+Dtstr+"','yyyy-mm-dd') where Comment_Id='" + this.InformIdTB.Text + "'";
OleDbDataAdapter objAdapter=new OleDbDataAdapter(strSql,objCn);
objAdapter.Fill(objDataSet,"Aided_Comment");
FillDataGridDG();
Dtstr = this.InformTimeTB.Text; if(NowIsAddInform)
strSql ="insert into Aided_Comment(Comment_Id,Topic_Comment,Commenter,COMMENT_CONTENT,Comment_time)values('" + this.InformIdTB.Text + "','" + this.InformTitleTB.Text + "','" + this.Informer.Text + "','" + this.InformContentTB.Text + "',to_Date('"+Dtstr+"','yyyy-mm-dd'))";
else
strSql ="update Aided_Comment set Topic_Comment='" + this.InformTitleTB.Text + "',COMMENT_CONTENT='" + this.InformContentTB.Text + "',Commenter='" + this.Informer.Text + "',Comment_time=to_Date('"+Dtstr+"','yyyy-mm-dd') where Comment_Id='" + this.InformIdTB.Text + "'";
OleDbDataAdapter objAdapter=new OleDbDataAdapter(strSql,objCn);
objAdapter.Fill(objDataSet,"Aided_Comment");
FillDataGridDG();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货