I'm pulling data from an Access database and placing it into a DataGridView. This is my code:
Is there any way I could simply export the DataTable to XML? What's the best method of doing this?
I'm still researching right now, but I also wanted to ask your opinions.
Thank you very much :)
Code:
Private Sub PopulateGrid(ByVal sqlQuery As String, ByVal grid As DataGridView)
' This connection string
Dim ConnectionString As String = "Provider = microsoft.ace.oledb.12.0; Data Source=|DataDirectory|/workout_tracker.accdb"
' Creates and uses an oledb data adapter
Using adapter As New OleDbDataAdapter(sqlQuery, ConnectionString)
' Creates the data table
Dim table As New DataTable
' Fills the data table with the adapters records
adapter.Fill(table)
' Sets the data grid's data source to the data table
grid.DataSource = table
End Using
End Sub
I'm still researching right now, but I also wanted to ask your opinions.
Thank you very much :)