문제

I'm using C# 2010 Express.

I have created a SQL Server CE database file (.sdf) then created Information table and ID, Name, City columns with Database Explorer. I want to save names and city user will write to the form. The auto-increment option is disabled in Database explorer and Properties windows. When I'm saving something to that database i must change the ID manually, how can I make ID column auto-increment enabled?

도움이 되었습니까?

해결책

There is a simple way for SQL CE:

ALTER TABLE TableName ALTER COLUMN ColumnName IDENTITY (/*seed*/1, /*increment*/1)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top