Answered Using stored Procedure in Lightswitch?

  • Tuesday, November 08, 2011 12:36 PM
     
     
    Detail steps showing how to Use stored Procedure from an exisiting database with parameter in Lightswitch?

All Replies

  • Tuesday, November 08, 2011 3:11 PM
     
     

    There is no built in ability to use Stored Procedure in LightSwitch.  However there are workarounds.  I have done both.

    1.  Create a RIA Service to call the Stored Procedure.

    2.  Create a Table which acts like a queue containing the Parameters of your Stored Proc.  On the triggers you can call your Stored Proc.  This also will allow you to have a kind of history of the calls.


    Derek
  • Tuesday, February 28, 2012 8:57 PM
     
     

    Ha, bullet 1. is not as trivial as the brevity of it's staement implies. Been working on this for a few days. Been through a few articles. The only comprehensive article executed a statement against the northwind database. The author admitted he had no success trying against a remote SQL Server DB. Perhaps you would be willing to share all the details connected with bullet 1. I have not been able to make it work. The frame work throws an error the minute I call the Open method on the [SqlClient] connection object.

    Thanks


    Harold Rosenkrans

  • Friday, April 20, 2012 6:04 PM
    Moderator
     
     Answered

    I have just published a blog article describing how you can accomplish this.  Please see

    http://blogs.msdn.com/b/eric_erhardt/archive/2012/04/17/executing-a-simple-stored-procedure-in-lightswitch.aspx

  • Thursday, April 26, 2012 8:37 AM
     
     
    Looking forward for part 2

    and also use it via wcf ria service