Export (0) Print
Expand All

How to: Specify Database Data Types (LINQ to SQL)

Use the LINQ to SQL DbType property on a ColumnAttribute attribute to specify the exact text that defines the column in a T-SQL table declaration.

You must specify the DbType property only if you plan to use CreateDatabase to create an instance of the database.

For code examples, see DbType.

To specify text to define a data type in a T-SQL table

  1. Add the DbType property to the ColumnAttribute attribute.

  2. Set the value of the DbType property to the exact text that is used by T-SQL.

Community Additions

ADD
Show:
© 2014 Microsoft