I'm trying to create a user using the SQL membership provider on SQL Express. When I use the TransactionScope
it prompts to DTC with no apparent reason, how can I avoid it?
Here is my example code:
using (var ts = new TransactionScope())
{
MembershipCreateStatus status;
Membership.CreateUser(username, password, null, null, null, true, out status);
var userProfile = ProfileBase.Create(username);
userProfile.SetPropertyValue("Fullname", fullname);
userProfile.Save();
ts.Complete();
}
BTW, I checked in reflector and every membership SQL function always closes its connection.