locked
ID, But No Name RRS feed

  • Question

  • I have an app that is a form for unauthenticated users. The datasource table causing an error is from an existing database and it only displays the table Primary Key ID as the summary in a dropdownlist. So I created a property property to display the string equivalent to display in the dropdownlist. From the screen shot, can someone help me discover how to fix the error there?

    Wednesday, February 20, 2013 5:19 AM

Answers

  • If SiteName is a computed property, you can't use that in your LINQ query, as the SQL Server data provider has no way of knowing what it is. Computed properties are a LightSwitch-specific concept.

    As far as only an ID showing in an AutoCompleteBox, if you had the correct 1-Many relationship defined in the database, then the ACB would "just work".


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Wednesday, February 20, 2013 11:32 AM
    Moderator

All replies

  • this.SiteName refers to the computed property itself, no?

    If so, using it inside the linq expression is a bit strange.

    try : where(n.SiteId == this.Id)  {no clue of course how SiteId is called in your external db}


    paul van bladel


    Wednesday, February 20, 2013 10:15 AM
  • If SiteName is a computed property, you can't use that in your LINQ query, as the SQL Server data provider has no way of knowing what it is. Computed properties are a LightSwitch-specific concept.

    As far as only an ID showing in an AutoCompleteBox, if you had the correct 1-Many relationship defined in the database, then the ACB would "just work".


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Wednesday, February 20, 2013 11:32 AM
    Moderator
  • Thanks guys. I ditched the computed property and used a query to set a screen property that displays the sitename and inserts the id properly. 


    Not sure how to mark an answer in this case.
    • Edited by Darnell Wednesday, February 20, 2013 10:57 PM
    Wednesday, February 20, 2013 10:55 PM