O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Microsoft Visual Studio LightSwitch Business Application Development

Book Description

A jump-start book and eBook to application development with Microsoft Visual Studio LightSwitch

  • 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#)

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 ski lls. 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 softw are 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

Table of Contents

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