What is bit data type equivalent in DBML?

1.5k views Asked by At

I'm mapping a column in a DBML to a bit column in SQL Server. Which of the following should "Type" (not server data type) in the DBML be marked as:

  • Binary (System.Data.Linq.Binary)
  • boolean
  • byte
1

There are 1 answers

0
GVashist On BEST ANSWER

From the MSDN reference http://msdn.microsoft.com/en-us/library/ms177603.aspx, for bit on MSSQL

"The string values TRUE and FALSE can be converted to bit values: TRUE is converted to 1 and FALSE is converted to 0."

Going by that logic, I would use boolean for your mapping.

NOTE: This is a pretty commonly discussed question on forums, including stack overflow. I'm certain there is a more comprehensive answer available.

I found a more comprehensive answer: C# Equivalent of SQL Server DataTypes