Awadhendra
Awadhendra

Reputation: 513

comparing data type of sql server and ms access in c#

Is there any method to compare the data types of two different Databases.

Upvotes: 0

Views: 6628

Answers (1)

Olivier Jacot-Descombes
Olivier Jacot-Descombes

Reputation: 112762

Jet Engine (Access) Sql-Server C#
Text (len < 256) char, nchar, varchar, nvarchar string
Memo text, ntext, char, nchar, varchar, nvarchar 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 string
binary, varbinary byte[]

I took this information from How to Migrate from Access to SQL Server 2000 and added the C# column.

Note also that most types are nullable in the databases. Map nullable columns to Nullable<T> (T?) in C# unless the .NET type is a reference type.

Upvotes: 8

Related Questions