N
news.kuleuven.be
I create a dataAdapter for Table in Access
-----
daTracks.SelectCommand.CommandText = "SELECT * FROM Tracks"
daTracks.FillSchema(DS, SchemaType.Source, "Tracks")
-----
In Acces the table has a primarykey 'ID' set to autoincrement
---
Dim myDataRow As DataRow = DS.Tables("Tracks").NewRow
myDataRow("Path") = nTrackPath
myDataRow("Track") = mTrack
DS.Tables("Tracks").Rows.Add(myDataRow)
Dim mTrackID = myDataRow("ID")
----
When adding a new datarow to the table in the dataset and asking for the ID,
i always get 0 as first ID (mTrackID = 0)
---
daTracks.Update(DS, "Tracks")
---
but when i update the table in access using the dataataper.update this new
created row gets ID = 1 in Access ?
Another problem:
after inserting 100 rows in the Access Table. I delete in Access the last
record in the table.
When adding a new datarow through the dataAdapter it gets ID 100 like it
shoud, but when the Access Table is update the ID is changed to 101 ?
How Come ?
-----
daTracks.SelectCommand.CommandText = "SELECT * FROM Tracks"
daTracks.FillSchema(DS, SchemaType.Source, "Tracks")
-----
In Acces the table has a primarykey 'ID' set to autoincrement
---
Dim myDataRow As DataRow = DS.Tables("Tracks").NewRow
myDataRow("Path") = nTrackPath
myDataRow("Track") = mTrack
DS.Tables("Tracks").Rows.Add(myDataRow)
Dim mTrackID = myDataRow("ID")
----
When adding a new datarow to the table in the dataset and asking for the ID,
i always get 0 as first ID (mTrackID = 0)
---
daTracks.Update(DS, "Tracks")
---
but when i update the table in access using the dataataper.update this new
created row gets ID = 1 in Access ?
Another problem:
after inserting 100 rows in the Access Table. I delete in Access the last
record in the table.
When adding a new datarow through the dataAdapter it gets ID 100 like it
shoud, but when the Access Table is update the ID is changed to 101 ?
How Come ?