locked
store new table data entities to sql server RRS feed

  • Question

  • When I click "new table" to create a new data entity, how can that table be placed in a database on my sql server server?  I created a new database on the server named "OrderManagement". Attach to external data source wants to attach to an existing table in a database. I want the new table/new data entities I create to be added to the OrderManagement database on the server.

    thanks,

     

    Sunday, August 29, 2010 12:10 AM

Answers

  • Hi Steve,

    There is no facility in LightSwitch for exporting tables/entities created in the Entity designer. Anything created in LightSwitch is stored in the intrinsic SQL Express database, and the schema is deployed with the application.

    As you noted, attach to external data source can only connect to tables in that data source. If you want the tables to be located in your external SQL database, you will need to create them in that database.

    Hope this helps,

     


    Steve Hoag Microsoft aka the V-Bee
    Sunday, August 29, 2010 1:30 AM
    Moderator

All replies

  • Hi Steve,

    There is no facility in LightSwitch for exporting tables/entities created in the Entity designer. Anything created in LightSwitch is stored in the intrinsic SQL Express database, and the schema is deployed with the application.

    As you noted, attach to external data source can only connect to tables in that data source. If you want the tables to be located in your external SQL database, you will need to create them in that database.

    Hope this helps,

     


    Steve Hoag Microsoft aka the V-Bee
    Sunday, August 29, 2010 1:30 AM
    Moderator
  • There is no facility in LightSwitch for exporting tables/entities created in the Entity designer. Anything created in LightSwitch is stored in the intrinsic SQL Express database, and the schema is deployed with the application.


     

    does this mean the business types like email address and phone number are only available to a sql express hosted app?

    Sunday, August 29, 2010 1:58 AM
  • The business types are independent of the type of data source.  These business types are more formally known as semantic types, in that they are semantic notions applied to existing data types.  As long as LightSwitch can recognize a field as being a string type, the phone number and email address types can be used.  If the field is a decimal, then it can be changed to money type.  If the field is a binary field (byte array), then it can be changed to image type.

    Sunday, August 29, 2010 2:29 AM
  • Not a SQL Express hosted app - any LightSwitch app, regardless of the data source.

    The custom business types in LightSwitch are intended to help with the display formatting and validation of data in a screen - basically shortcuts to keep you from having to write a ton of UI code. Under the covers they are stored as their native data type. For example, an EmailAddress type is really just a String, and it is stored in the intrinsic database as a String.

    You can also use custom business types on fields from external data sources, and they are treated the same way - for example, a PhoneNumber type can be assigned to a Phone field of type String in your external SQL database. Of course it doesn't help if you are using that same database field in, say, a WinForms application - it's just a benefit of using LightSwitch.

    Hope this helps,

     


    Steve Hoag Microsoft aka the V-Bee
    Sunday, August 29, 2010 2:38 AM
    Moderator