R
RAM
Hello,
I am learning .NET. I am writing database application which contains some
operations accessible from ASP.NET menu. This operations should be separate
transactions.
I wrote:
public partial class PZ : System.Web.UI.Page
{
bool Commited;
protected void Page_Load(...)
{
if (!IsPostBack)
{
Cache["Transaction"] = Admin.Conn.BeginTransaction["PZ"];
Commited = false
}
}
protected void Save_Click(...)
{
SqlTransaction t = (SqlTransaction)Cache["Transaction"];
if (t != null)
t.Commit();
Commited = true;
}
}
I don't know where to put Rollback code. I cannot do it in Page_Unload
because page is reloaded because of list box control.
Could you give me some suggestion how to do it?
Thank you
/RAM/
I am learning .NET. I am writing database application which contains some
operations accessible from ASP.NET menu. This operations should be separate
transactions.
I wrote:
public partial class PZ : System.Web.UI.Page
{
bool Commited;
protected void Page_Load(...)
{
if (!IsPostBack)
{
Cache["Transaction"] = Admin.Conn.BeginTransaction["PZ"];
Commited = false
}
}
protected void Save_Click(...)
{
SqlTransaction t = (SqlTransaction)Cache["Transaction"];
if (t != null)
t.Commit();
Commited = true;
}
}
I don't know where to put Rollback code. I cannot do it in Page_Unload
because page is reloaded because of list box control.
Could you give me some suggestion how to do it?
Thank you
/RAM/