Hi,
I have a datatable in VB.net and i want to dump this table in MSAccess as new table.
How can i achieve this.... i need to do this from code only
Following is code snippet
Dim TableAdapter As New OleDb.OleDbDataAdapter("SELECT * FROM Test", con)
Try
dtTable = New DataTable
TableAdapter.Fill(dtTable) ' Fill the data table
'Update the EUID column values with description
For Each column As DataColumn In dtTable.Columns
If column.ColumnName.Contains("EUID") Then
'Update each value with description
For i As Integer = 1 To dtTable.Rows.Count - 1
'get the description of
the
dicEngg.TryGetValue(IIf(dtTable.Rows(i).Item(column.ColumnName)
= " ", 0, dtTable.Rows(i).Item(column.ColumnName)), strValue)
If strValue Is Nothing
Then
dtTable.Rows(i).Item(column.ColumnName) = ""
Else
dtTable.Rows(i).Item(column.ColumnName) = strValue.Trim()
End If
Next
End If
Next
' Create a new table in MSAccess
'Create table in MSaccess using "dtTable" datatable object
dtTable.Clear()
dtTable.Dispose()