-
April 23rd, 2010, 06:41 AM
#1
ADO.NET cross-base transactions Pin
I made a simple transaction using ADO.NET:
SqlTransaction tn;
SqlConnection cn = new SqlConnection(/*connection string to 'Database1'*/);
try {
if (cn.State != ConnectionState.Open)
{
cn.Open();
}
}
catch (SqlException ex)
{
Debug.Assert(false, ex.ToString());
}
tn = cn.BeginTransaction();
SqlCommand cmd2 = ...
This works nicely. However I would like to make some update statement in other database - 'Database2'. Is it possible to do that inside one ADO.NET transaction? If so, how?
Thank you for help in advance.
-
April 23rd, 2010, 11:57 AM
#2
Re: ADO.NET cross-base transactions Pin
Check out TransactionScope.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|