Suppose you have a datagridview whose name is datagrid1. Now you are copying all the values of that datagrid in the dataset. Since datagrid1 has only one table so we are inserting that values as a DataTable in the Dataset. Now we have a DataAdapter da, this DataAdapter will update the table in the database using DataSet.