Hello,
I am in the process of writing my first app using CSLA (so please bare with me).
I have no problem retreiving data from a SQL DB. However when I try to perform an update, an exception is thrown.
The code is as follows:
[
Transactional(TransactionalTypes.TransactionScope)] protected override void DataPortal_Update(){
// if we're not dirty then don't update the database if (!this.IsDirty) return; using (SqlConnection cn = new SqlConnection(Database.BridgeBearingConnection)){
cn.Open();
using (SqlCommand cm = cn.CreateCommand()){
cm.CommandText =
"updateDeliveryDateUpdate";cm.CommandType =
CommandType.StoredProcedure;cm.Parameters.AddWithValue(
"@intDeliveryDateUpdateId", _intDeliveryDateUpdateId);cm.Parameters.AddWithValue(
"@dteRevisedDate", _dteRevisedDate);cm.Parameters.AddWithValue(
"@strRevisionReason", _strRevisionReason);cm.ExecuteNonQuery();
}
MarkOld();
}
}
The error occurs at cn.Open(). I know my connection string is OK as I can retrieve data OK.
The error message is:
{"The partner transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D025)"}
Any help greatly appreciated.
Roger Smith
Try removing the attribute:
[Transactional(TransactionalTypes.TransactionScope)]
as a test to see if your code works correctly.
Joe
Good guess Brian.
DTC was enabled on both the Client and Server. However, it was not configured correctly. I found the following link useful in resolving this:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=230390&SiteID=1
Joe: I originally had no Transaction Attribute but still got the error. Not sure why as I understand having no attribute defaults to Manual Transactions.
Thanks for the help!
Roger.
Copyright (c) Marimer LLC