0
private Boolean Saveuser(bool isNew)
{
    tb_User user = new tb_User();

    user.User_Name = txtUserName.Text.Trim();
    user.User_LoginName = txtLoginName.Text;
    user.User_Password = txtPassord.Text;
    user.User_ModifiedBy = clsGlobalVariable.strusername;
    user.User_Modified = DateTime.Now;
    user.User_IsDeleted = false;
    user.User_IsUpdated = true;
    user.User_UserGroup = "";
    user.User_UserType = "";
    user.User_WarehouseCode = "";
    user.SetIsNew(isNew);

    user.Save();
}

when I try to insert new user using above coding, it is worik, but try to update existing user by passing isNew (false). It is not working, when I trace inside activerecord.cs, the dirty column count is always 0 for both new and update. How can I update the existing record? Please answer for me? Thanks.

1 Answer 1

1

You should

  1. Get the record
  2. Update record
  3. Save

    User u = User.FetchByID(2345);

    u.User_Name = "blablabla";

    //other User object modifications...

    u.Save();

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.