I use this code to add users and this is like the one in register.aspx :
MembershipUser m = Membership.CreateUser(nU.UserName, nU.PassWord, nU.Email, "The greatest band ever?", "none", true, out status);
if (m == null)
{
ErrorStr.Msg += GetErrorMessage(status) + Environment.NewLine;
return ("{\"error\":0}");
}
else
{
try
{
userId = DSC.User.AddUser(nU.UserName, true, CoreHelper.GetReferralId(), nU.FirstName,
nU.LastName, nU.CompanyName, nU.Address, nU.Address2, nU.City, nU.State,
nU.Zipcode, nU.CountryId, nU.Phone, nU.PhoneExt, DateTime.Now, true);
Membership works fine and DSC.user also returns userID and works without error.
No record in DSC.User and DSC.Address tables.
|