Beginning LightSwitch in Visual Studio 2013 - Address Book HTML Sample

Beginning LightSwitch in Visual Studio 2013 - Address Book HTML Sample

Rate This
  • Comments 4

I just uploaded the completed sample that you build step-by-step in the Beginning LightSwitch in Visual Studio 2013 Article Series. If you’re completely new to LightSwitch or HTML5/JavaScript development, then this series is for you. It walks you through everything you need to know to get started quickly building professional quality business apps for mobile devices & tablets, suitable for a wide range of form factors.

imageDownload the Sample & Read the Tutorials

Download the sample here.

Read this article series to get started with the most important concepts you need to build any LightSwitch HTML business application:

  • Part 1: What’s in a Table? Describing Your Data
  • Part 2: Feel the Love - Defining Data Relationships
  • Part 3: Screen Templates, Which One Do I Choose?
  • Part 4: Too much information! Sorting and Filtering Data with Queries
  • Part 5: May I? Controlling Access with User Permissions
  • Part 6: More Control! Customizing the app with JavaScript & CSS
  • Build and Run the Sample

    1. Download the sample ZIP file to your computer, right-click on the ZIP, select properties, and Unblock the file.
    2. Then extract the contents of the ZIP and double-click on the .SLN file to open Visual Studio.
    3. Important: From the BUILD menu, select "Rebuild Solution" to generate the necessary files to run the sample.
    4. After you rebuild, press F5 to run.
  • Visit the LightSwitch Developer Center for more tutorials and get started learning! For LightSwitch questions and troubleshooting please visit the LightSwitch Forums.

    Have fun building your first apps!


    Leave a Comment
    • Please add 4 and 6 and type the answer here:
    • Post
    • Thanks .....

    • Hello Beth:

      This project is tied to a local host to run in the browser which points to my question...what if you developed on a local machine, but wanted to later connect to a server like SQL or MySQL?  I'm trying to see how versatile this app is when it comes to connecting a finished product to a separate backend database where the fields are predefined correctly.

      If I'm not being specific enough, please let me know and I will revise my question.  Thank you in advance!

    • Hi Joe,

      This tutorial assumes you will be using a SQL Server database when you deploy the application. During development, if you design your entities in the data designer, LightSwitch uses your LocalDB SQL database (that is installed with Visual Studio) while debugging. However, you can use any version of SQL server (2008 express, which is free, or higher versions) to deploy, including SQL Azure.

      If you want to use a database that already exists, then you need to select "Attach to External Data" instead of choosing "Add New Table". But that would mean that you need to maintain that database separately from your application. Many people prefer this even if it is a SQL database especially if the database schema is complex.  

      I don't have much experience with MySQL, but here is a video from one of our MVPs on how to get it to work with LightSwitch.

      For more information on deployment see:

      On premises:

      In Azure: (same steps for an HTML client, except you don't need to worry about signing the XAP)



    • Hi Beth,

      I'm a little confused, try to include a method best search to a client page (HTML) where they can search for separate phrases, as an example if I search "carlos rojas" and in the field of BD this as "rojas carlos" normal search not found, that in I resolve simply switch phrases in lightswitch have to do an extended consultation, but I did not know how to link it to the page where I want to return the query, here the code fragment I did in an extended search by code on the server:

      Private Sub BusquedaAvanzada_PreprocessQuery(StrBuscar As String, ByRef query As System.Linq.IQueryable(Of LightSwitchApplication.ProductosItem))

                 Dim BuscarInvertido As String = ""

                 Dim Matriz() As String

                 StrBuscar = Replace(StrBuscar, " ", "%")

                 StrBuscar = "%" & StrBuscar & "%"

                 Matriz = StrBuscar.Split("%")

                 For i = Matriz.Length - 1 To 0 Step -1

                     BuscarInvertido = BuscarInvertido & "%" & Matriz(i)


                 BuscarInvertido = BuscarInvertido & "%"

                 query = From Productos In query

                         Where Productos.DESCRIPCION Like StrBuscar Or BuscarInvertido

                         Select Productos

             End Sub

      Is it too much trouble you can help me with this question?

      Thanks and greetings from Mexico

    Page 1 of 1 (4 items)