C# to SQL Server datatype mappings

  • Thread starter Thread starter Mark Rae
  • Start date Start date
M

Mark Rae

Hi,

Can anyone please point me to a definitive mapping of SQL Server 2000
datatypes to C# datatypes?

I'm currently using the mapping below, but I'm sure some aren't correct...

BigInt, int
Binary, object
Bit, bool
Char, string
DateTime, DateTime
Decimal, decimal
Float, float ???
Image, object
Int, int
Money, decimal
NChar, string
NText, string
NVarChar, string
Real, float ???
SmallDateTime, DateTime
SmallInt, int
SmallMoney, decimal
Text, string
Timestamp, object ???
TinyInt, byte
UniqueIdentifier, object ???
VarBinary, object ???
VarChar, string
Variant, object ???


Any assistance gratefully received.

Mark
 
Mark Rae said:
Can anyone please point me to a definitive mapping of SQL Server 2000
datatypes to C# datatypes?

Have a look at the docs for the SqlDbType enumeration. That should be
the definitive version.
 
Back
Top