CRM2011 – C# Datatypes

These are the common datatypes relations between CRM2011 and C# types.

 

CRM2011  Visual Studio 2010 Asign Command SQL Server
EntityReference Entity[“Field”] = new EntityReference(“Entity Related”, Data Type Guid(“Related Entity ID”)) uniqueidentifier
Client Entity[“Field”] = new EntityReference(“Entity Related(account/contact)”, Data Type Guid(“Related Entity ID”)) uniqueidentifier
OptionSet Entity[“Field”] = new OptionSetValue(Data Type Int) int
Currency Entity[“Field”] = new Money(Data Type Decimal) money
2 options Entity[“Field”] = Data Type Bool bit
DateTime Entity[“Field”] = Data Type Datetime o Datetime.ToString(“format”) datetime
Line of text Entity[“Field”] = Data Type String nvarchar
Decimal Number Entity[“Field”] = Data Type Decimal decimal
Integer Number Entity[“Field”] = Data Type Int int
Double Entity[“Field”] = Data Type Double float
Owner Entity[“Field”] = new EntityReference(“Related Entity(systemuser)”, Data Type Guid(“Related Entity ID”)) uniqueidentifier
Long Text Entity[“Field”] = Data Type String (long text) nvarchar(-1)
Advertisements

One thought on “CRM2011 – C# Datatypes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s