I am writing an app in VB2010. My code parses a text file, assigns data to variables My?????, and then attempts to store this data in an access 2010 (actually access 2007 format) table. Yet, whenever my code gets to MyRow.Item("Artist") = MyArtist I get an error 5 'Artist' does not belong to Table MyTable, but the field/column does exist in the table as do all the others. any ideas?
[code]
Dim tbl As DataTable = New DataTable(MyTable)
tbl.Rows.Add()
Dim lastRow As Integer = tbl.Rows.Count - 1
Dim MyRow As DataRow = tbl.Rows.Item(lastRow)
MyRow.Item("Artist") = MyArtist
MyRow.Item("[Album Title") = MyAlbum
MyRow.Item("Release Year") = MyYear
MyRow.Item("Track Title") = MyTitle
MyRow.Item("Duration") = Microsoft.VisualBasic.Left(MyDuration, 5)
MyRow.Item("Image Path") = MyImgPath
MyRow.Item("Counter") = Counter
MyRow.Item("Collection") = MyCollection
MyRow.Item("Track No") = MyTrack
tbl.Rows.Add(MyRow)
[/code]