C # WinForms - DataGridView / SQL Compact - negative integer in primary key column

I'm just getting dirty at WinForms, and through a wonderful tutorial I discovered the magic of dragging and dropping a database table into a design view of my main form. So, everything is fine, I have a DataGridView with all the columns presented beautifully.

BUT...

When I run my application against this new, empty .sdf (empty save for the two tables I created that are empty by themselves), I get -1 in the column corresponding to the primary key / identifier column when I try to create this first record.

Any idea why this might happen? If that helps, column int.

+3
source share
2

Identity , -1. , , , ? , .

+3

@Brian -1 - , "" , , , . 0 1, , , .

, , (-2, -3, -4) . , , "" .

+5

Source: https://habr.com/ru/post/1696627/


All Articles