我的控件是:textbox
数据表是classdata
字段是wentilist
private bool func()
{
bool secceed = true;
string strSQL = "insert into classdata(wentilist) values('" + textbox.Text.ToSting() + "')";
base.ConnectionOpen();
OracleTransaction myTranse = base.MyConn.BeginTransaction();
OracleCommand myComm = new OracleCommand(strSQL, base.MyConn, myTranse);
try
{
myComm.ExecuteNonQuery();
myTranse.Commit();
secceed = true;
}
catch
{
myTranse.Rollback();
secceed = false;
}
finally
{
myComm.Dispose();
myTranse.Dispose();
base.ConnectionClose();
}
return secceed;
}
楼主看看这个吧
[此贴子已经被作者于2007-1-24 12:58:39编辑过]