Dataset depuis un datasource
Bonjour,
J'aimerais obtenir un datatable depuis le datasource d'une gridview :
Code:
1 2 3 4 5
| Dim Table As DataTableCollection = DsGrid.Tables
BindSource.DataSource = Table(0)
BindSource.Filter = "Nom LIKE '" & SearchNom & "'
Me.DataGridViewVisiteur.DataSource = BindSource
Dim dt as datatable = CType(Me.DataGridViewVisiteur.DataSource, DataTable) |
J'obtient le message :
Citation:
Unable to cast object of type 'System.Windows.Forms.BindingSource' to type 'System.Data.DataTable'.
Comment faire ?
merci.