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.
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
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\MSSQLSERVER;Initial Catalog=AdventureWorks2012;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.