When the ableableadapt set generated by vs IDE is used in different forms to access the SDF database, if the database is modified in the first form, then the second form is new, and read the datatableadapt In the second form. The read data is the data before the modification.
I am very embarrassed about this phenomenon.CodeThe reason cannot be found at the level. the breakpoint indicates that the data is the old data when dataadapt takes the data and fills it into the dataset. However, using ADO to directly execute SQL queries is the normal data after modification. In this case, like a cache, the generated code reads the old data every time. WhenProgramAfter it is disabled, it is enabled again. I don't know if it is a problem with the SDF database, but it does exist ......
After finding this problem, I found the code problem for a long time, but it was still fruitless. Finally, I wrote ADO to fill the dataset and showed it to the datagridview. Winform development is a bit interesting. If you are not familiar with it, sometimes it is too disgusting ......