C# to SQL Server datatype mappings

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
 
J

Jon Skeet [C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top