ispiro
ispiro

Reputation: 27723

Binary cannot be primary but the only column that doesn't change is binary

I have a simple table with few columns which I'm accessing using Linq2sql. The only column that doesn't change is binary. But when I try to make it the primary column - Linq2sql tells me that:

System.Byte[] is not supported for identity members.

(It means primary. There's no identity in the table.)

And if I don't set any primary column linq2sql tells me that it can't work without a primary key.

And if I set a different column as primary - I can't change that column.

What would be a solution here?

Upvotes: 0

Views: 71

Answers (1)

Dale K
Dale K

Reputation: 27448

Add a unique id column e.g.

alter table mytable add id int identity (1,1)

Upvotes: 2

Related Questions