locked
How to use like SQL Server quary to LightSwitch quary RRS feed

  • Question

  • i work as well this below query for sql server 2008

    Select * from table where id%2 <>0

    BUT i want to use this query for light switch. but how?

    Here need to type Write Code? what code will work for that please tell me VS LightSwitch Query Page

    Wednesday, January 1, 2014 3:43 PM

Answers

  • Hi Omar

    You can write SQL queries in a WCF RIA service. 

    As the image shows, you can use "Add Query", it allows add filter, sort. Here is Beth's video - Sort and Filter Data on a Screen in a LightSwitch Application, it will be helpful for you.

    Best 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.

    • Marked as answer by Angie Xu Wednesday, January 15, 2014 6:29 AM
    Thursday, January 2, 2014 7:36 AM

All replies

  • Hi Omar

    You can write SQL queries in a WCF RIA service. 

    As the image shows, you can use "Add Query", it allows add filter, sort. Here is Beth's video - Sort and Filter Data on a Screen in a LightSwitch Application, it will be helpful for you.

    Best 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.

    • Marked as answer by Angie Xu Wednesday, January 15, 2014 6:29 AM
    Thursday, January 2, 2014 7:36 AM
  • Omar, You can write a query using code. On the screen click "write code" and select the "preprocessor" query. You will need to use LINQ to write the query. There are plenty of blog post examples out there for writing LINQ queries in lightswitch. I found using LINQPad helpful in learning LINQ.... It's a free download, just use bing or google to search for it. The other option is a WCF as Angie notes and Beth's videos are helpful too. Michael Washington has some other examples on his site (lightswitchhelpsite.com). Good luck.

    -----
    MrStu

    Thursday, January 2, 2014 11:33 AM