Related to http://stackoverflow.com/questions/1660200/how-to-debug-a-linq-to-sql-insertonsubmit-statement
I Execute the following bit of code:
db.DBUsers.InsertOnSubmit(new DBUser
{
Id = id,
BrandCode3 = brandCode3.ToLower(),
LoweredUsername = username.ToLower(),
Username = username,
CreationDate = date,
Salt = salt,
Password = SecurityService.CreateMD5Hash(salt + password),
PasswordQuestion = passwordQuestion,
PasswordAnswer = passwordAnswer,
Comment = comment,
Email = email,
IsApproved = isApproved,
LastPasswordChangedDate = date,
FailedPasswordAnswerAttemptCount = 0,
FailedPasswordAnswerAttemptWindowStart = date,
IsLockedOut = false,
IsOnLine = false,
LastActivityDate = date
}
);
db.SubmitChanges();
UPDATE
Here's the attributes for the primary key:
[Column(Storage="_Id", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
public System.Guid Id
I noticed that the Auto-sync property has the value "Never" in the properties window. My guess would be this needs to be OnInsert. Gonna check that.
Right before I call submitchanges I check the change set and it shows no inserts, updates or deletes...
SQL profiler shows me no query is sent, attaching a db.Log shows me no action is executed.
Why isn't anything submitted?