” or “How do I read a database into _______ control and then update the database?
” So I figured I would put a few little snippets here to show you some ways it can be done.
Because i use a formula value Of Quantity In Database - value Of Quantity In System, it update properly and successful Here is my problem goes: Let's say i got a Data Grid View with Quantity column and the value of it is 50 (This make a Quantity value in Database become 950) and let's say customer want to add his Quantity from 50 to 150, so i change the value of Quantity in Data Grid View to 150 from 50, the Database should update based on the formula value Of Quantity In Database - value Of Quantity In System, and the Quantity in Database should have 850 in Quantity value (Because 1000 - 150), the Quantity value in database is 800 (Because first time i add is 50, so the Quantity in database is 950, next i add another 150 and the Quantity in database is 800), so it is like first entered value second entered value. I know my command is missing the "WHERE" clause, but i don't know what to put in the "WHERE" clause.
Here is what i want: Whenever user edit the Quantity in Data Grid View, it should goes to this formula value Of Quantity In Database - value Of Quantity In System ------ (So, whenever user change the Quantity value in Data Grid View, let's say it change to 150 from 50, the Quantity in Database should recognized it and minus with current value of Quantity in Data Grid View (150), not the older one (50) Here is the of datagridview (photo) when i run the program: Here is the photo of my GUI in program: I want when the user select "ID 9" and click the "delete" button, it will delete the selected row also delete it at database. Here is the code that i have been doing right now (the following code is delete row in a single click) but why when i clicking the "delete" button, it is delete all records in the datagridview, but it does not updating to the database?
I got a Quantity column in Data Grid View, and i got a feature where user could edit the Quantity column in Data Grid View and automatically updating the Quantity value in the Database.
Once the program is closed the database resets to its previous state.
I have a problem that am trying to solve for hours.
Its 2 in the morning and even after reading tones of articles I still cannot solve the problem.
I have c# windows app that loads data from ms access database into a data Grid View.
I can succesfully load it, However when I try to edit/remove rows and then save it I obtain error: Dynamic SQL generation for the Delete Command is not supported against a Select Command that does not return any key column information.
And also i want that only a selected row that has been selected that is gonna be delete.