Microsoft Visual Studio LightSwitch Business Application Development

Microsoft Visual Studio LightSwitch Business Application Development
eBook: $35.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $95.98    Print cover: $59.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • A hands-on guide, packed with screenshots and step-by-step instructions and relevant background information—making it easy to build your own application with this book and ebook
  • Easily connect to various data sources with practical examples and easy-to-follow instructions
  • Create entities and screens both from scratch and using built-in templates
  • Query using built-in designer and by coding (both VB and C#)

Book Details

Language : English
Paperback : 384 pages [ 235mm x 191mm ]
Release Date : September 2011
ISBN : 1849682860
ISBN 13 : 9781849682862
Author(s) : Jayaram Krishnaswamy
Topics and Technologies : All Books, Application Development, Microsoft Development , Cookbooks, Enterprise, Microsoft

Table of Contents

Chapter 1: Getting Started with Microsoft LightSwitch
Chapter 2: Microsoft LightSwitch IDE and Architecture
Chapter 3: Accessing Data from a VSLS Application
Chapter 4: Screens in VSLS application
Chapter 5: Working with Entities
Chapter 6: Querying and Filtering Data
Chapter 7: Writing Code in Microsoft LightSwitch
Chapter 8: Authentication and Authorization in Microsoft LightSwitch
Chapter 9: Deploying LightSwitch Applications
Chapter 10: Troubleshooting, Debugging, Custom Controls, and Extensions
  • Chapter 1: Getting Started with Microsoft LightSwitch
    • What is Visual Studio LightSwitch and who is the target audience?
    • Basic architecture of a VSLS application
      • The VSLS designers
    • Installing Microsoft LightSwitch
      • Installing on Windows 7
        • Installation problems and remedies
      • Installing on Windows XP
    • Installing the databases used in the book
      • Downloading the samples
      • Installing the databases on SQL Express 2008
    • Summary
    • References
    • Chapter 2: Microsoft LightSwitch IDE and Architecture
      • Visual Studio LightSwitch Beta 2 application architecture
        • Presentation tier
        • Logic tier
        • Data Access Service and Data storage
        • Business logic
        • Hosting Process
      • Visual Studio LightSwitch Beta 2 IDE
        • The Start page
        • The Main menu
      • Exploring the LightSwitch Project
        • Creating a new project
        • Project
          • File View of the application
      • Summary
      • References
      • Chapter 3: Accessing Data from a VSLS Application
        • WCF RIA service
          • Components of a WCF RIA service
        • Creating data entities in LightSwitch applications
          • Creating a table (or entity) in a LightSwitch application
          • Data types in Microsoft LightSwitch
          • Salesman table
        • Creating data entities using an external data source
          • Review of business-related Northwind database tables
          • Attaching to external data
            • Accessing data on a database
            • Accessing data on SharePoint 2010
            • Accessing data from a WCF RIA Service
        • Summary
        • References
        • Chapter 4: Screens in VSLS application
          • Screens, data, and visual presentation
          • Microsoft LightSwitch screens
            • New Data Screen
              • Creating a screen
              • Binding screen to data source
              • Screen properties
              • Displaying the screen
            • Search Data Screen
              • Testing the functionality
              • Can you add or modify the data in the Search Data Screen?
            • List and Details Screen
            • Creating a screen from scratch
              • Create an unbound Search Data Screen
              • Add a group
              • Add a data item
              • Add an AutoCompleteBox
              • Display and test combo-box
            • Export to Excel functionality
              • Disabling Export to Excel
            • Customizing a screen at runtime
          • Summary
          • References
          • Chapter 5: Working with Entities
            • Entities in Microsoft LightSwitch
              • Entity Designer
              • Creating data entities: adding, deleting, and modifying fields
                • Choice list
                • Setting up a default e-mail domain
                • Entering Money field
                • Setting up Phone Properties (formatting)
              • Adding a computed field
                • Computed value using the Edit Method
              • Entity field validation
                • Built-in validation
                • Custom Validation
              • How are the code pages organized in the project?
              • Relationships between entities in LightSwitch
              • Relationships between tables (entities) from an attached source
                • What is the workaround?
                • How to establish a many-to-many relationship?
            • Summary
            • References
            • Chapter 6: Querying and Filtering Data
              • Querying in LightSwitch
              • Querying a Single Entity
                • Filtering and sorting the data
                  • Filtering the data
                  • Sorting the list
                  • Queries using a parameter
              • Querying multiple entities
                • AutoCompleteBox to set the parameter value
                • Static spans
              • Querying a query
              • Summary
              • References
              • Chapter 7: Writing Code in Microsoft LightSwitch
                • Getting started with writing code
                  • Why do you write code?
                  • Where to write the code?
                  • How you write code?
                  • Data Model and Screens in LightSwitch
                • Writing and testing code targeting the entity
                  • Inserting default values in the entity
                  • Inserting data into an entity by code
                  • Validating entity
                • Writing and testing screen-related code
                  • Entering default values using code with screens
                  • Overriding default behavior
                  • Accessing screen elements
                • Writing custom queries using code
                  • A simple query with code
                  • Query with selection and sorting
                  • Query with text search
                  • Data from related tables
                  • Finding records by navigation
                  • Using a query to add data
                • Summary
                • References
                • Chapter 8: Authentication and Authorization in Microsoft LightSwitch
                  • Authentication schemes
                  • Access permission
                    • Permissions with Forms authentication
                      • Creating screen Permissions with Forms authentication
                      • Where is the permission saved?
                      • Permission to a button
                      • Permission to query
                      • Permitting a user to run a query
                      • Permission to a query based on another query
                      • Permission to Entity
                    • Permissions with Windows authentication
                      • LightSwitch Project with Windows Authentication
                      • User testing the WindowsAuthenticationVB
                    • Associating Permissions with roles
                    • Permission elevation of server code
                      • Elevating the permission example
                  • User Management
                  • Summary
                  • References
                  • Chapter 9: Deploying LightSwitch Applications
                    • Publishing and maintaining a two-tier desktop application
                      • Installing the application
                      • Running the application
                      • Adding users
                      • Publishing updates to the application
                      • Deploying the application to another computer
                      • Removing the application
                    • Publishing to Web
                      • Where do you publish to?
                      • Certificate-backed deployment
                    • Publishing a three-tier application
                      • Publishing a three-tier application with Forms Authentication
                      • Displaying the application
                      • Publishing a three-tier application with Windows Authentication
                    • Publishing application to Windows Azure
                      • Creating the application to be deployed to Windows Azure
                      • Obtaining the subscription to Windows Azure and configuring the hosting site
                      • Preparing the application for Forms Authentication and deployment to Windows Azure
                      • Publishing to Windows Azure hosting site
                    • Creating a package for publication
                    • Summary
                    • About using project download from the Packt site
                    • Reference
                    • Chapter 10: Troubleshooting, Debugging, Custom Controls, and Extensions
                      • Troubleshooting
                      • Debugging LightSwitch applications
                        • LightSwitch Debug Menu
                      • Adding custom controls to LightSwitch
                        • Creating a User Control
                      • Extensions
                        • Theme extension using CookBook recipe
                          • Setting up the right environment
                          • Creating a theme extension
                          • Installing the extension
                          • Using the extension
                          • Changing the design of the theme
                      • Summary
                      • References

                      Jayaram Krishnaswamy

                      Jayaram Krishnaswamy studied at the Indian Institute of Science in Bangalore India and Madras University in India and taught at the Indian Institute of Technology in Madras. He went to Japan on a Japanese Ministry of Education Research scholarship to complete his PhD in Electrical Engineering from Nagoya University. He was a Post-Doctoral Fellow at Sydney University in Australia; a Government of India Senior Scientific Officer at the Indian Institute of Science in Bangalore and Indian Institute of Technology at Kanpur; a Visiting Scientist at the Eindhoven Institute of Technology in the Netherlands; a visiting Professor of Physics at the Federal University in Brazil; an Associate Research Scientist at a government laboratory in São Jose dos Campos in São Paulo, Brazil; a visiting scientist at the National Research Council in Ottawa, Canada before coming to USA in 1985. He has also taught and worked at the Colorado State University in Fort Collins and North Carolina State University in Raleigh, North Carolina. He worked with Northrop Grumman Corporation on a number of projects related to high energy electron accelerators and Free Electron Lasers. These projects were undertaken at the Brookhaven National Laboratory in Long Island and in the Physics Department at Princeton University. He has over 80 publications in refereed and non-refereed publications and 8 issued patents. He is fluent in Japanese and Portuguese and lives in Honolulu, Hawaii, USA.

                      He has been working in IT-related fields since 1997. He was once a Microsoft Certified Trainer in Networking and a Siebel Certified developer. He has worked with several IT related companies, such as the Butler International in their Siebel practice, with several IBM sub-contractors and smaller companies. Presently he is active in writing technical articles in the IT field to many online sites such as,,,,,, Egghead Café,, Packt Article Network,,, and many others. Between 2006 and 2010 he wrote more than 400 articles mostly related to database and web related technologies covering Microsoft, Oracle, Sybase, ColdFusion, Sun, and other vendor products.

                      He has written four books all published by Packt related to Microsoft Database and Application Development: SQL Server Integration Services Using Visual Studio 2005, Learning SQL Server Reporting Services 2008, Microsoft SQL Azure; Enterprise Application Development, and Microsoft Visual Studio Lightswitch Business Application Development. He regularly writes for his four blogs on Blogger;,,, and He received the 2011 Microsoft Community Contributor award.

                      Contact Jayaram Krishnaswamy

                      Sorry, we don't have any reviews for this title yet.

                      Code Downloads

                      Download the code and support files for this book.

                      Submit Errata

                      Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

                      Sample chapters

                      You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                      Frequently bought together

                      Microsoft Visual Studio LightSwitch Business Application Development +    WS-BPEL 2.0 for SOA Composite Applications with IBM WebSphere 7 =
                      50% Off
                      the second eBook
                      Price for both: $53.70

                      Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                      What you will learn from this book

                      • Download and install Visual Studio LightSwitch on Windows 7 and Windows XP; also install the required sample databases
                      • Create a local entity, and connect to external data sources including SQL Servers and WCF RIA Data services
                      • Work with screens in different business activities
                      • Design queries using the built-in query designer for filtering and sorting data
                      • Deploy the various security features to your application
                      • Deploy your application in various topologies

                      In Detail

                      Visual Studio LightSwitch is a new development tool for building business applications for the desktop, the web, and the cloud with ease. You can easily do most of the designing for your application, but for building business applications you need to acquire the right skills. With this book you will gain confidence in working with LightSwitch, and the skills you acquire will greatly help you to develop applications yourself.

                      This Visual Studio LightSwitch Business Application Development book is dedicated to giving you hands-on experience, when it comes to developing applications on LightSwitch. Everything, right from downloading the software to creating your application to deploying it, is discussed extensively. All this is laid out in an easy to understand and step-by-step format.

                      You will learn how to set up your database and link to the data whether it is on a local or remote database. Once you know how to work with data, you will then learn to set up screens and use screen templates. Work with entities and LightSwitch specific data types; query and filter data with designer and code. Write simple and complex queries with and without writing code. You will also write custom code using the built-in event handlers.

                      No business software can function without addressing security issues and Visual Studio LightSwitch has a rock solid, deceptively simple way to handle security and you will learn to do this from scratch with ASP.NET. Once the application is built you will explore the different ways to deploy it.

                      Get familiar with Visual Studio LightSwitch application development—from exploring the user interface to deployment techniques


                      The book is designed to introduce the various components and funtionalities of LightSwitch. This book will appeal to LightSwitch self-starters, as most of the examples are complete—not just snippets—with extensive screenshots. The chapters progress from downloading software to deploying applications in a logical sequence.

                      Who this book is for

                      This book is for developers who are beginning to use Visual Studio LightSwitch. Small business houses should be able get a jump start on using LightSwitch. The book does not assume prior knowledge of Visual Studio LightSwitch but exposure to SQL Server, Silverlight, and Microsoft IDEs such as Visual Studio (any version) will be of great help. The book should be useful to both Visual Basic and C# programmers.

                      In addition to small businesses, this book will be useful to libraries, schools, departmental applications, and to those who might be writing applications to be hosted on desktop, internet and Windows Azure platforms.

                      Code Download and Errata
                      Packt Anytime, Anywhere
                      Register Books
                      Print Upgrades
                      eBook Downloads
                      Video Support
                      Contact Us
                      Awards Voting Nominations Previous Winners
                      Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                      Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software