Data Types in LightSwitch Beta 1

Posted in .net, LightSwitch, Microsoft, Software, SQL, Visual Studio by tejana on November 5, 2010

A Simple Definition List for new LightSwitch Users

Thanks to Steve Anonsen for the data type table for LightSwitch. As a consolidator of  data sources, LightSwitch converts incoming schema to the available data type options. Notice that when creating a new table inside of LightSwitch’s entity designer the non optional initial column is named “Id” , of type int32, and is required. By attaching to a database other data types are allowed but are translated to the designer’s available data type options. For attached database models, for example, a small money is represented in LightSwitch as a decimal with 10 as precision and 4 as scale. Changing the type on the entity designer to the “business type” money, retains storage as a decimal and adds formatting and additional behavior in LightSwitch. This will have to be done for each business type field in an attached Sql database. The ability to add business types is expected in later releases.



When building the model in LightSwitch. Tables are created in SQLExpress to represent the entities along with the application tables in “applicationdatabase.mdf” in bin/data or bin/data/temp. The particulars of the mdf file in Beta 1 can be viewed in Sql Server Management Studio. One can also, publish the application:







The Publish Application Wizard gives the option to Publish directly to the database now. You  can publish to see the tables in Sql Server Management Studio. LightSwitch uses nvarchar() to store strings unless you attach to a database.


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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: