Insert rows into Access Table in order from c#
I have a sorted list of insert statements that I am trying to write to an Access db. I have triple verified that the list of insert statements is in the correct order. When I open the mdb file the records are never in order. Maybe for the first 100 records, but after that it starts getting out of whack.
I am really at a loss here, any ideas? Note that this table is being created in开发者_Python百科 C# first dynamically - i.e. the set of of columns is not predictable each time this code needs to be run.
Maybe you just need to add an ID field to the tables and then the insertion order should be maintained.
When adding rows to any database, the concept of "Order inside a Table" is meaningless.
You get your order when retrieving records by using an ORDER BY.
Make sure you have an ID or TimeStamp column to sort on.
精彩评论