You are here:   Blog
Register   |  Login

 

By Richard Waddell on 2/8/2013 11:51 PM

 

image

LightSwitch provides for creating Data Sources in several ways. In the case of an existing database you would typically either specify the database itself or a WCF RIA Service.

image

But sometimes neither is feasible. I was confronted with a database with no primary keys and incredibly wide tables – so wide that I got error messages about it. And you can’t really do much with a database that has no primary keys. Also modifying the schema was not an option.

This actually turned out to be quite liberating. The reason we wanted to access the database outside of the legacy application it was designed for was to

  • Provide views of the data that the legacy application did not.
  • Add additional columns

By extracting the data into another database we could

  • Eliminate literally hundreds of columns (Yes, I do mean literally)
  • Create primary keys
  • Create relationships with referential integrity through foreign keys
Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation