A Basic Example of CRUD with DataGridView in VB.Net being one of my more popular posts, I thought I should provide a C# example. I find people on stackoverflow.com continue to struggle with setting up DataAdapters to perform inserts, updates and deletes, and the use of WinForms is still often the platform used by beginners and students.
So here is a small sample application demonstrating how easy it is. There is an embeded SQLite database so you can immediately run the project without worrying about database setup. The code itself is easily translated for your data provider of choice – where you see “SQLite” just replace it with “SQL” or “OleDB”, or whatever you are using:
SQLiteCommand => becomes => SqlCommand
This time I’ll allow the code to speak for itself, get it here on GitHub.