جرب
DA = New OleDb.OleDbDataAdapter("SELECT * FROM Sell_Detl", con)
DA.Fill(DT)
For I = 0 To dgv.Rows.Count - 2
Dim DR1 = DT.NewRow
If dgv.CurrentRow.Cells(10).Value = Nothing Then
dgv.CurrentRow.Cells(10).Value = 0
End If
DR1!BUYCODE = TXTID.Text
DR1!Code = dgv.Rows(I).Cells(0).Value
DR1!Name = dgv.Rows(I).Cells(1).Value
DR1!Price = Val(dgv.Rows(I).Cells(2).Value)
DR1!Unit = dgv.Rows(I).Cells(3).Value
DR1!Quant = dgv.Rows(I).Cells(4).Value
DR1!Cost_Unit = dgv.Rows(I).Cells(5).Value
DR1!Total = dgv.Rows(I).Cells(6).Value
DR1!Tax = dgv.Rows(I).Cells(7).Value
DR1!TaxVal = dgv.Rows(I).Cells(8).Value
DR1!DS = dgv.Rows(I).Cells(9).Value
DR1!DSVAL = dgv.Rows(I).Cells(10).Value
DR1!Stock = dgv.Rows(I).Cells(11).Value
DR1!QTY_IN = dgv.Rows(I).Cells(12).Value
DR1!RowNum = TextBox5.Text
DT.Rows.Add(DR1)
Dim CMD_ As New OleDb.OleDbCommandBuilder(DA)
DA.Update(DT)
Next
