I have limited knowledge in coding.
can anyone tell me what is worng with my code?
the firstrow result in the database is not updated, but it is updated in datagridview.

For i As Integer = 0 To DataGridView1.RowCount - 1
            DataGridView1.Rows(i).Cells(11).Value = "true"

You have to update the datasource of the datagrid view.

A DataAdapter will do the job:

Dim da As OleDB.OleDBDataAdapter(New OleDB.OleDBCommand("SELECT * FROM TabelName",MyDbConnection)) 'Make sure the connection passed in is open.
da.UpdateCommand = New OleDBCommandBuilder(da).GetUpdateCommand()' If not you will have to open the connection before calling this line.
da.Update(MyDataGridViewSource) 'Where MyDataGridViewSource is a DataSet

Edited 3 Years Ago by Begginnerdev

thank you but the result is still leaving out the first row.
but stressed from unable to do it, so I have no choice I just update it straight to the database using

This question has already been answered. Start a new discussion instead.