ColumnAttribute.Expression Property
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Gets or sets whether a column is a computed column in a database.
Namespace: System.Data.Linq.Mapping
Assembly: System.Data.Linq (in System.Data.Linq.dll)
Syntax
'Declaration
Public Property Expression As String
public string Expression { get; set; }
Property Value
Type: System.String
Default = empty.
Remarks
Use this property when you use CreateDatabase to define a column as containing computed values.
For example, if you want to create a column defined in SQL as InventoryVal AS UnitPrice * UnitsInStock, use the following expression string: "UnitPrice * UnitsInStock".
Note: |
---|
LINQ to SQL does not support computed columns as primary keys. |
Topic | Location |
---|---|
How to: Represent Computed Columns (LINQ to SQL) | LINQ to SQL |
How to: Represent Computed Columns (LINQ to SQL) | LINQ to SQL |
Version Information
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.