locked
In ASP.NET lightswitch, how do I use parameterized SQL User Defined Functions(UDF) from an existing database as a data source for a Screen Data? RRS feed

  • Question

  • I need to rewrite an existing Access application in Lightswitch. I've used the upsize wizard to convert all the queries to regular SQL User Defined Functions (UDFs) returning tables, then fixed them by hand where the wizard didn't quite do it right.

    The typical screen in this access app calls a UDF, passes it two date parameters, and displays the results. By doing it this way, I don't need to reinvent the complex where clauses in the existing queries.

    My question is, how do I do this? I can take an existing view or table and build a screen from it, but how do I create a screen and cause it to pass parameters to the UDF, and use the returned data as the source for a screen? (or gridview or report instead of a screen, but screens seem to be what lightswitch is best at.)

    Alternatively, I can rewrite the queries in LINQ or whatever. But with lots of searching, I haven't seen how to do this. I know asp.net web forms, etc, but this is my first lightswitch project, and any pointers would be much appreciated. Thanks!

    Tuesday, January 21, 2014 1:52 PM

Answers

  • Hi jw Goethe

    >I've used the upsize wizard to convert all the queries to regular SQL User Defined Functions (UDFs) returning tables, then fixed them by hand where the wizard didn't quite do it right.

    Thanks for your feedback.

    Stored procedures, user-defined functions, and other SQL objects are not supported and do not appear in the Choose your Database Objects dialog box. If you want to use stored procedures, you can do so by writing a custom RIA service. You can learn relevant information about this online.

    Regards

    Angie


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Edited by Angie Xu Thursday, January 23, 2014 9:29 AM
    • Marked as answer by Angie Xu Sunday, February 9, 2014 7:38 AM
    Thursday, January 23, 2014 9:29 AM