I have searched for a few days on the internet how to create a Databinding form that I can use for editing values, but no luck. I would really appreciate if someone can help me out!
Reading values works perfectly, but update/insert does not.
FormLoad:
newRow = issueTable.NewRow();
newRow["ID"] = Id;
issueTable.Rows.Add(newRow);
txtName.DataBindings.Add("Text", issueTable, "Name");
Save:
SqlCommandBuilder build = new SqlCommandBuilder(adaptor);
adaptor.InsertCommand = build.GetInsertCommand();
adaptor.Update(issueTable);
My problem is that in the SQL table: “ID” get stored, but “Name” stay null. What is strange for me is that if I monitor issueTable.Rows[0][“Name”], it return the value on the Form.
Thank you!
The problem is that I wanted to Insert and Edit at the same time. I did not realize that if a row is in an Insert state, that it blocks Updates.
Solution:
Load:
Save: