Save changes to datagridview to database using vb.net
I am working on a windows froms project which i am using a datagridview control on. I am populating the grid using a datatable which all works find. I want to be able to save any changes or new rows that the user adds or makes to the rows in the gridview. How to i save the changes back to the database. I am using the following code to populate the grid:
Dim sSQL As String = "SELECT * FROM tblLine_Items WHERE Rec_ID = '1' ORDER BY RecordNumber"
Dim cn As New SqlConnection(sconnstring)
Dim da As New SqlDataAdapter(sSQL, cn)
If cn.State = ConnectionState.Closed Then