datawindow.net 为什么保存不了UpdateData不好使,代码如下:
Sybase.DataWindow.AdoTransaction SQLCA;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Bind();
//SQLCA.Connection.Close();
}
}
private void Bind()
{
SQLCA = new Sybase.DataWindow.AdoTransaction(DataConnection.GetConnection());
SQLCA.BindConnection();
dw_test.SetTransaction(SQLCA);
dw_test.Retrieve("ldj");
SQLCA.Connection.Close();
} protected void btnLoad_Click(object sender, EventArgs e)
{
Bind();
}
protected void btnAdd_Click(object sender, EventArgs e)
{
Bind();
dw_test.InsertRow(0);
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
Response.Write(dw_test.ModifiedCount);
//if (dw_test.ModifiedCount > 0||dw_test.DeletedCount > 0)
// {
try
{
SQLCA = new Sybase.DataWindow.AdoTransaction(DataConnection.GetConnection());
SQLCA.BindConnection();
dw_test.SetTransaction(SQLCA);
SQLCA.Transaction = SQLCA.Connection.BeginTransaction();
//dw_test.SetItemString(6, "Templatename", "aaaaa");
dw_test.UpdateData(true,true);
SQLCA.Transaction.Commit();
dw_test.ResetUpdateStatus();
dw_test.Retrieve("ldj");
}
catch (Exception ex)
{
SQLCA.Transaction.Rollback();
}
finally
{
SQLCA.Connection.Close();
}
}
//}
protected void btnDelete_Click(object sender, EventArgs e)
{
Bind();
int row = dw_test.CurrentRow;
dw_test.DeleteRow(0);
}点击btnUpdate保存按钮时,没有错误但是也没有保存,不管我怎么更改数据dw_test.ModifiedCount = 0 为什么,请大侠们帮忙,我困扰好几天了。
Sybase.DataWindow.AdoTransaction SQLCA;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Bind();
//SQLCA.Connection.Close();
}
}
private void Bind()
{
SQLCA = new Sybase.DataWindow.AdoTransaction(DataConnection.GetConnection());
SQLCA.BindConnection();
dw_test.SetTransaction(SQLCA);
dw_test.Retrieve("ldj");
SQLCA.Connection.Close();
} protected void btnLoad_Click(object sender, EventArgs e)
{
Bind();
}
protected void btnAdd_Click(object sender, EventArgs e)
{
Bind();
dw_test.InsertRow(0);
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
Response.Write(dw_test.ModifiedCount);
//if (dw_test.ModifiedCount > 0||dw_test.DeletedCount > 0)
// {
try
{
SQLCA = new Sybase.DataWindow.AdoTransaction(DataConnection.GetConnection());
SQLCA.BindConnection();
dw_test.SetTransaction(SQLCA);
SQLCA.Transaction = SQLCA.Connection.BeginTransaction();
//dw_test.SetItemString(6, "Templatename", "aaaaa");
dw_test.UpdateData(true,true);
SQLCA.Transaction.Commit();
dw_test.ResetUpdateStatus();
dw_test.Retrieve("ldj");
}
catch (Exception ex)
{
SQLCA.Transaction.Rollback();
}
finally
{
SQLCA.Connection.Close();
}
}
//}
protected void btnDelete_Click(object sender, EventArgs e)
{
Bind();
int row = dw_test.CurrentRow;
dw_test.DeleteRow(0);
}点击btnUpdate保存按钮时,没有错误但是也没有保存,不管我怎么更改数据dw_test.ModifiedCount = 0 为什么,请大侠们帮忙,我困扰好几天了。
这个怎么使用阿,怎么能把数据窗口里的数据存到ViewState中阿。