PC Review


Reply
Thread Tools Rate Thread

C# to SQL Server 2000 datatype mappings

 
 
Mark Rae
Guest
Posts: n/a
 
      18th Jun 2005
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


 
Reply With Quote
 
 
 
 
Frans Bouma [C# MVP]
Guest
Posts: n/a
 
      18th Jun 2005
Mark Rae wrote:

> 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.


the mappings I use:
BigInt = System.Int64
Binary = System.Byte[]
Bit = System.Boolean
Char = System.String
Datetime = System.DateTime
Decimal = System.Decimal
Float = System.Double
Image = System.Byte[]
Int = System.Int32
Money = System.Decimal
NChar = System.String
NText = System.String
Numeric = System.Decimal
NVarChar = System.String
Real = System.Single
SmallDateTime = System.DateTime
SmallInt = System.Int16
SmallMoney = System.Decimal
Sql_Variant = System.Object
SysName = System.String
Text = System.String
TimeStamp = System.Byte[]
TinyInt = System.Byte
UniqueIdentifier = System.Guid
VarBinary = System.Byte[]
VarChar = System.String

FB


--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      18th Jun 2005
"Frans Bouma [C# MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> the mappings I use:


Very useful - thanks a lot.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use the xml sql server datatype with c# Andy B Microsoft C# .NET 1 17th Feb 2008 09:26 AM
sql server 2000 datetime datatype Jesse Aufiero Microsoft Access Forms 1 6th Dec 2006 04:17 PM
C# to SQL Server datatype mappings Mark Rae Microsoft C# .NET 2 18th Jun 2005 12:52 PM
Drive Mappings not showing up on W2K Server JS Microsoft Windows 2000 Terminal Server Applications 1 19th Aug 2004 03:59 AM
Linking SQL Server 2000 to Access - Bigint datatype Ken McAndrew Microsoft Access External Data 4 2nd Apr 2004 05:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:31 PM.