Subject .net provider does not appear to commit changes
Author Simon Carter
I am using Visual Studio 2003 and the firebird 1.0 .net provider (and
firebird 1.0.???) in a web based .net project I have the following code to
update a table

private void Submit_Click(object sender, System.EventArgs e) {
FbConnection db = new FbConnection();
db.ConnectionString = Global.ConnString;
db.Open();

FbTransaction tran = db.BeginTransaction();

FbCommand sql = new FbCommand();
try
{
sql.Connection = db;
sql.Transaction = tran;

sql.CommandText = "UPDATE WS_NEWS SET NEWS_TEXT = @NEWSTEXT " +
" WHERE NEWS_ID = @NEWSID";
//NEWS_DATE = @NEWSDATE
sql.Parameters.Add("@NEWSTEXT", FbType.Text, "NEWSTEXT");
//sql.Parameters.Add("@NEWSDATE", FbType.TimeStamp, "NEWSTEXT");
sql.Parameters.Add("@NEWSID", FbType.Integer, "NEWSID");

sql.Parameters[0].Value = NewsText.Text;
//sql.Parameters[1].Value = NewsDate.Text;
sql.Parameters[1].Value = NewsID;

// Execute Update
sql.ExecuteNonQuery();

// Commit changes
tran.Commit();

GetNewsItem();
}
finally
{
// Free command resources in Firebird Server
sql.Dispose();
}
}

All compiles and runs with no errors however the table is never updated, if
anyone can shed some light on this problem it would be appreciated.

Rgds

Si Carter
TECT Software Ltd
http://www.tectsoft.net