string connectionString =
"Data Source =|DataDirectory|\\user.sdf";
User context = new User(connectionString);
Userdetail newUser = new Userdetail();
newUser.Username = txtReg.Text;
newUser.Password = txtRegPassword1.Password;
try
{
context.Userdetail.InsertOnSubmit(newUser);
context.SubmitChanges();
}
catch (ChangeConflictException)
{
context.ChangeConflicts.ResolveAll(System.Data.Linq.RefreshMode.KeepChanges);
}
I want to add the new row of data (username, password) into the existing database but unfortunately it gets added temporarily only. As soon as the program is closed, the database is reverted to what it was.. Any help would be highly appreciated