This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Use the LINQ to SQL IsPrimaryKey property on the ColumnAttribute attribute to designate a property or field to represent the primary key for a database column.
For code examples, see IsPrimaryKey.
LINQ to SQL does not support computed columns as primary keys.
Add the IsPrimaryKey property to the ColumnAttribute attribute.
Specify the value as true.