Dim DS As New DataSet
DS.Clear()
Dim DPX As New OleDbDataAdapter("Select * From CityTb", Cn)
DPX.Fill(DS, "CityTb")
Dim Bilder1 As New OleDbCommandBuilder(DPX)
For Each row As DataRow In DS.Tables("CityTb").Rows
For I As Integer = 0 To DataGridView1.RowCount - 2
If DataGridView1.Rows(I).Cells(0).Value = row.Item("City") Then
MsgBox("added")
Else
Dim DRw As DataRow = DS.Tables("CityTb").NewRow
With DRw
.Item(1) = DataGridView1.Rows(I).Cells(0).Value
.Item(2) = Val(IDLb1.Text)
End With
DS.Tables("CityTb").Rows.Add(DRw)
DPX.Update(DS, "CityTb")
End If
Next
Nextكيف يتم اضافة البيانات
وفي جاالة تشابه البيانات لا يتم اضافتها
شكرا