Use. Net to compile an InterfaceProgramIt involves data access. The working language has always been c ++, and the self-confidence msdn is in the hands. In the case of a C # ADO program, the MVC Architecture is probably designed.
Under the framework of the program, the function of capturing and displaying data is quickly completed, but the function of writing dirty data back to the database using update cannot be achieved, and the return value of update is also 0. The method is reference.
As mentioned in the example on msdn, there is no problem, but the reality is cruel. Next we started the long and tangled 25,000-mile long march to find a solution, the process saves 10 thousand words ......
Summarize experiences directly
First, the database table design must have a primary key to ensure that the dataset file generated based on the data table contains the complete insert, delete,
Update,
Select SQL statement. If the table does not have a primary key, the SELECT statement can only be normal. Check the ***. Designer. CS file. Freight expert
Second, the sample program provided by msdn is incorrect. You must call the endedit method before calling update. I personally think that Microsoft needs endedit in the update Method
If this parameter is triggered, the dirty data is written to the corresponding able, so that the update statement is executed based on the data changes.