M
Mark Baldwin
I have an application with both Windows Forms and ASP.NET front ends and
uses both integrated web security and a security database. The problem I
have is that I need to syncronize these security databases.
The web front end uses ASP membership with the SQL provider, the database is
moved to the SQL Server instead of the SQL Express datafile.
The Windows Forms app uses tables such as "users" within the database.
If I add a user on the website, I need also to add a user to the database
"users" table.
To achieve this I write a business layer component that wraps both the
security data tables and the ASP.NET membership functions. So for instance,
to delete a user...
[DataObjectMethod(DataObjectMethodType.Delete, true)]
static public void Delete(string UserName)
{
// delete user from internal database table "users"
usersTableAdapter UserTableAdapter = new usersTableAdapter();
int rowsAffected = UserTableAdapter.DeleteByName(UserName);
// delete user from ASP.NET membership database
Membership.DeleteUser(UserName, true);
}
The question is how do I get these two functions into a transaction so that
if the deletion for the ASP.NET member fails, the delete on the internal
database table is rolled back?
uses both integrated web security and a security database. The problem I
have is that I need to syncronize these security databases.
The web front end uses ASP membership with the SQL provider, the database is
moved to the SQL Server instead of the SQL Express datafile.
The Windows Forms app uses tables such as "users" within the database.
If I add a user on the website, I need also to add a user to the database
"users" table.
To achieve this I write a business layer component that wraps both the
security data tables and the ASP.NET membership functions. So for instance,
to delete a user...
[DataObjectMethod(DataObjectMethodType.Delete, true)]
static public void Delete(string UserName)
{
// delete user from internal database table "users"
usersTableAdapter UserTableAdapter = new usersTableAdapter();
int rowsAffected = UserTableAdapter.DeleteByName(UserName);
// delete user from ASP.NET membership database
Membership.DeleteUser(UserName, true);
}
The question is how do I get these two functions into a transaction so that
if the deletion for the ASP.NET member fails, the delete on the internal
database table is rolled back?