Jet Engine (Access) | Sql-Server | C#
--------------------+-------------------------------------+--------------------
Text (len < 256) | char, nchar, varchar, nvarchar | string
Memo | text, ntext, the above with len>255 | string
Byte | tinyint | byte
Integer | smallint | short
Long Integer | integer (int) | int
Single | real | float
Double | float | double
Replication ID | uniqueidentifier | Guid
Decimal | decimal | decimal
Date/Time | smalldatetime, datetime, datetime2 | DateTime
Binary (8 bytes)| timestamp, rowversion (Since V2008) | byte[] (8 bytes)
Currency | smallmoney, money | decimal
AutoNumber | int + identity property | int
Yes/No | bit | bool
OLE Object | image | byte[]
Hyperlink | <no equivalent> | string
<no equivalent> | binary, varbinary | byte[]
Я взял эту информацию из Как перейти с Access на SQL Server 2000 и добавил столбец c #.
Обратите внимание также, что большинство типов допускает обнуление в базах данных. Преобразуйте пустые столбцы в Nullable<T>
(T?
) в C #, если только тип .NET не является ссылочным типом.