Download: Update and Insert data in database from datagridview

By Bhuban Shrestha


TIP: Right-click and select "Save link as.." to download video

Initializing link download... Initializing link download.....

Connect with me On LinkedIn:

Sometime user needs to update large amount of data in such case updating data from datagrid view is good choice because user gets all information in a row format. In this video tutorial you will learn how to update database table from datagrid view. You can insert, upadate and delete data of database from datagrid view.
In this video tutorial deleting is not shown but it is very simple. Just select row then update.

You have to include primary key column in data grid view.
If you want to hide primary key column to user then you can achieve this by

datagridview1.Columns[0].Visible=false ;//0 is the index of primary key column

datagridview1.Columns["PrimaryKey"].Visible=false; //PrimaryKey is a column header text of primary key.