In this chapter, you will learn to create a simple application based on a single data source. This is enough to understand how LightSwitch works and how you can take advantage of all its features to create high-quality, professional business software quickly.

Visual Studio LightSwitch is a Rapid Application Development (RAD) environment focused on making it easier to build line-of-business applications (that is, data-centric software). Up to now, you have learned what LightSwitch is and a fair bit about its integrated development environment (IDE), but there is a lot more to learn. Starting from this chapter, you begin developing applications with LightSwitch, and in the process, you learn how easy it is to build complex applications in a very few steps. This is the probably the most important chapter in the book because it provides the fundamentals of LightSwitch development, offering tons of information about creating data sources, creating screens, and implementing data validation, and covering important concepts such as business data types. In this chapter, you create a simple application based on a single data source. This is enough to understand how LightSwitch works and how you can take advantage of all its features to create high-quality, professional business software quickly.

Creating a New Application

This chapter guides you through the process of building an application that enables you to keep track of all your contacts, such as family members, friends, and co-workers. You will be able to store information about each person you add to your contacts list. For example, you might want to add information such as name, phone number, email address, and so on. Although this might look simple, this example teaches you how to use a number of LightSwitch features.

To create a new project, select File, New Project, and in the New Project dialog, select the LightSwitch Application (Visual Basic) project template.

Why Visual Basic?

Code examples in this book are presented in Visual Basic. If you develop in Visual C#, you can download the C# version of the code from this book’s page on the InformIT website. The reason for using Visual Basic is that one of the Visual Studio LightSwitch’s purposes is to make migration to the .NET Framework easier for developers coming from Microsoft Visual Basic 6, Microsoft Access, or Microsoft Visual FoxPro.

Click OK. After a few seconds, LightSwitch shows the LightSwitch Designer introduced in Chapter 2, “Exploring the IDE.” This is when you decide how to create the data source for the application. As you will learn throughout this book, Visual Studio LightSwitch can create new data sources or grab schemas and data from existing sources such as SQL Server or other databases, SharePoint, or WCF RIA Services. Right now, however, you are at a point when you still have a lot to learn about LightSwitch, so the best approach for a complete understanding is to create a new table from scratch.