public bool idletimesetting(string idletime)
{
string sUpdateQuery="";
OleDbConnection con = new OleDbConnection(IUCGlobals.connectionprovider);
OleDbCommand cmd = new OleDbCommand();
OleDbTransaction trans = null;
try
{
sUpdateQuery = "UPDATE IUC_CON_USER SET F_IDLE_MINS =" + Convert.ToInt16(idletime.Trim());
sUpdateQuery += "WHERE F_USER_ID =" + IUCGlobals.gLoggedUserId;
trans = con.BeginTransaction();
cmd.Connection = con;
cmd.Transaction = trans;
cmd.CommandText = sUpdateQuery;
cmd.ExecuteNonQuery();
trans.Commit();
return true;
}
catch
{
return false;
trans.Rollback();
}
}
In Catch part trans.Rollback();我收到此错误,请帮我纠正此问题, 提前谢谢。