this is a code to add data in the datagrid:
Private Sub btnAddSupplier_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddSupplier.Click
btnAddSupplier.Text = "Update Suppliers"
Dim ds As DataSet
If btnAddSupplier.Text = "Update Suppliers" Then
DataGrid1.ReadOnly = False
OleDbSuppliers.TableMappings.Add("Table", "SuppliersInfo")
OleDbSuppliers.Fill(ds, "SuppliersInfo")
DataGrid1.SetDataBinding(ds, "SuppliersInfo")
End If
End Sub
An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll
Additional information: The DataTableMapping.SourceTable is required to be unique, 'Table' already exists in the collection.
How to correct this??
2006-08-03
03:08:15
·
2 answers
·
asked by
braich_gal
3
in
Programming & Design