1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Sub charger_datagrid(ByRef ObjetDataTable)
Try
con.Open()
ObjetCommand = New OleDbCommand("select champ from table")
ObjetDataAdapter = New OleDbDataAdapter(ObjetCommand)
ObjetCommand.Connection() = con
bui = New OleDbCommandBuilder(ObjetDataAdapter)
ObjetDataAdapter.Fill(ObjetDataSet, "table")
ObjetDataTable = ObjetDataSet.Tables("table")
dv.Table = ObjetDataTable
dv.AllowNew = False
con.Close()
Catch ex As Exception
MsgBox(ex.Message)
con.Close()
Finally
con.Close()
End Try
End Sub |
Partager