ms access table data into application dataset table

Posted 17 October 2013 - 07:32 PM

Hi there, I am trying to load the contents of a table from an ms access database into a dataset table that I have added to my application. Currently I'm just loading it into a data grid view like this:

Public Function GetUser(ByVal Name As String) As DataTable
Dim query As String = "SELECT * FROM Users WHERE Username = @Name"
Dim cnGetRecords As New OleDbConnection
cnGetRecords.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & My.Settings.EquipmentDatabase
Dim cmdGetRecords As New OleDbCommand()
Dim daGetRecords As New OleDbDataAdapter()
Dim dsGetRecords As New DataTable()
cmdGetRecords.Parameters.Clear()
Try
With cmdGetRecords
.CommandText = query
.CommandType = CommandType.Text
.Parameters.AddWithValue("@Username", Name)
.Connection = cnGetRecords
End With
DataAccess.HandleConnection(cnGetRecords)
Dim oBindingSource As DataTable = DataAccess.GetDataTable(cmdGetRecords)
'now check to make sure a BindingSource was returned
If Not oBindingSource Is Nothing Then
'return the binding source to the calling method
Return oBindingSource
Else
'no binding source was returned
Throw New Exception("There was no BindingSource returned")
Return Nothing
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
Return Nothing
Finally
'Close the connection
DataAccess.HandleConnection(cnGetRecords)
End Try
End Function

On my main form I have the dataset called 'App_DataSet' with an empty table named 'Table_Users' , how would I fill the table instead of the datagridview?