Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
i've a data grid view control bound to an mdb file. the first field is id. i've not made the mdb file. when in program i see that whenever i come to create a new row the id gets -1. if i leave it and go to another row indicating i'm not going to add a new row and return to it (last row) the field gets -2. when i repeatedly do this i see that the value gets decremented each time.

at first the mdb file has two rows with ids 1 and 2. if it's defined as an auto-increment field, it must be initialized with 3 each time, not to decrement each time.

since this is my first try with data grid view, please inform me about this behavior and how can i fix this?

thx
Posted
Comments
BobJanova 18-Jul-12 10:17am    
Are you sure the .mdb is not set up to auto-decrement keys? A data bound DGV is quite a thin wrapper around its data source.
ilostmyid2 19-Jul-12 3:49am    
so u believe that the source is the MDB file. how can i check that it's setup to auto-decrement? i found no option when i opened it in access.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900