DataGridView to update database tables

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: DataGridView to update database tables

Post by jvierra »

I am not saying never use it. You cannot use it to create a connected data table. With the adapter we get the correct pieces to auto-generate the update/insert/delete SQL. When we execute the $datatable.Update() command the data is posted back. Only changes are posted. All changes including inserts, updates and deletes are posted as a set of batches.
User avatar
Ravi Lobo
Posts: 38
Last visit: Wed Oct 10, 2018 6:29 am

Re: DataGridView to update database tables

Post by Ravi Lobo »

jvierra wrote:I am not saying never use it. You cannot use it to create a connected data table. With the adapter we get the correct pieces to auto-generate the update/insert/delete SQL. When we execute the $datatable.Update() command the data is posted back. Only changes are posted. All changes including inserts, updates and deletes are posted as a set of batches.
Ok. I got it. That's very cool--Only changes getting updated. That's a huge plus. Thank you for all the information. I love the tool. It is very handy.
This topic is 7 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked