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
Computers & Internet
➔ Programming & Design
If this code is wrong, please supply me with a sample code to add data in datagrid...using vb.net and MS Access
2006-08-03
03:09:11 ·
update #1