Executing a Simple Stored Procedure in LightSwitch

This sample shows you how to execute a simple stored procedure in Visual Studio LightSwitch. This involves writing code that executes on the middle tier and invoking that code from a client side button.

5 Star
8,181 times
Add to favorites
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question

  • 555-555-0199@example.com
    1 Posts | Last post October 12, 2017
    • 555-555-0199@example.com
  • COM automation on the middle tier
    2 Posts | Last post November 06, 2013
    • I have developed the COM (dll) component to work with the data (CRUD) using Visual FoxPro and deployed it as a Web Service. Сomponent implements all the business logic of the application. I want to use it in LightSwitch. How can I do this?
    • To integrate custom data sources into LightSwitch, you can build a WCF RIA Service that calls into your custom data source/business logic.  The WCF RIA Service can then be imported into LightSwitch, and you can use it like any other data source.
      Michael Washington has a ton of examples on building WCF RIA Services on his help site: http://lightswitchhelpwebsite.com/.  For example, here's a good starter:  http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/34/Creating-a-Simple-LightSwitch-RIA-Service-using-POCO.aspx
  • What changes are needed to execute this simple stored procedure with the VSLS HYML Client (Update 2)?
    1 Posts | Last post May 15, 2013
    • What changes are needed to execute this simple stored procedure with the VSLS HYML Client (Update 2)? I have not been able to find an example.
  • Any caveats concerning the connection string?
    2 Posts | Last post February 12, 2013
    • I'm having trouble connecting to my instance of Sql Server. 
      "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
      Named Pipes is enabled and the server has been restarted. Here's my string:
      connectionString="Provider=SQLNCLI11.1;Integrated Security=SSPI;Initial Catalog=AdventureWorks2012;Data Source=Z7561\MSSQLSERVER" />
    • Try using the following format: 
      connectionString="Data Source=Z7561\MS​SQLSERVER;Initial Catalog=Adventu​reWorks2012;Integrated Security=True"
      I don't suggest using "Provider=SQLNCLI1.1". 
      See http://msdn.microsoft.com/en-us/library/ms254500(v=VS.80).aspx for more help on using connection strings.
  • Great Job!!
    1 Posts | Last post April 30, 2012
    • Awesome!! Great samples!!!