Q: How to use TableAdapter to update a row into SQL database (C#) Here is my code:
using (var conn = new SqlConnection(sqlConnectionString))
{
    conn.Open();
    using (var trans = conn.BeginTransaction())
    {
        if (SaveChanges(conn, trans, user))
        {
            trans.Commit();
        }
        else
        {
            trans.Rollback();
        }            
    }
}

private bool SaveChanges(SqlConnection sqlConnection, SqlTransaction transaction, User aUser)
{
    try
    {
        dt = new UserInformationDataSet.UserInformationDataTable();
        using (var adpt = new UserInformationTableAdapter())
        {
            adpt.Connection = sqlConnection;
            adpt.Transaction = transaction;

            UserInformationDataSet.UserInformationRow row = dt.NewUserInformationRow();
            row.Name = aUser.Name;
            row.Email = aUser.Email;
            row.Position = aUser.Position;
            row.IDNumber = aUser.IDNumber;
            row.Sex = aUser.IsMale;
            row.CreateDate = aUser.CreateDate;
            row.Password = aUser.Password;

            int debug = adpt.Update(row);
            return true;
        }
    }
    catch (Exception e)
    {
        MessageBox.Showe(e.ToString());
    }
    return false;
}

Here is the picture of my database structure:

The debug always will be 0, which means nothing updated. How can I do it correctly? I am not going to allow any user to change Email (the Primary Key) now. However, if I want to user to be able to change everything including the Primary Key, how can I do it? My friend told me a solution: make a List<User> allUser, that contains every user information from the database. When a user makes a change, then update in the allUser first, and then clean every row in the database and re-add them with allUser. I tried, and it works but I do want to DO it so, because I do not want to remove every row and re-add it again, that is just wasting time and if two users using the database at the same time and both of them make changes, then the first one's change will be overwritten by the last one. So, I am wondering that is there any other better way to do it? 

A: I checked .Update() function which, generate by the Visual Studio. There is nothing in it but only the name of the function. However, .Insert() and .Delete() have the actual code to insert and delete row into the database. I do not know why the Visual Studio does not do the update automatically, but to make a guess, I think I have to use SqlCommandBuilder to add some query statement for that. Anyway, what I am doing now is create a new query for the UserInformationTableAdapter() called UpdateUser and I manually add the query statement for it. Now, everything is fine.
