You are here:   Forum
Register   |  Login

Forum Notice

For new Visual Studio LightSwitch questions,
It is recommended that you use the official Visual Studio LightSwitch Forums at
:

http://social.msdn.microsoft.com/forums/en-US/lightswitch/threads


Forums

Getting data from a query and using it on screen
Last Post 18 Jun 2012 05:54 AM by Rhino2075@gmailc.com. 2 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
RhinoSmithUser is Offline
New Member
New Member
Send Private Message
Posts:2
Avatar

--
17 Jun 2012 02:31 PM
        I have a screen with several autocomplete boxes populated by queries and set up as 1 to many relationships. The queries and autocomplete boxes work as intended. I cannot, however, figure out how to access the other data in the query when the user selects it. 
        For instance, if a user selects a customer and that customer has several ship to addresses which are popluated in an autocomplete box based on the selected customer. The query works fine..the auto box shows the customers ship to names. But I need to popluate the screen with the acutal address data, i.e., address, city, state when the user changes the ship to.
        Everything I've done through code only points to the first record in the query and not the one selected. It would seem that dragging the field onto the screen from the query would work, but it does not. I've used code in the property change event equivalent to Me.ScreenCityProperty=Me.query.City. This always points to the first record in the query and never for the selecteditem. This seems so simple to do.

    Thanks in advance,

    Rhino
    hgminervaUser is Offline
    Veteran Member
    Veteran Member
    Send Private Message
    Posts:98
    Avatar

    --
    17 Jun 2012 04:43 PM
    You can do this using Linq. Below is the pseudo code to get the idea:

    Dim Addreses = (from s in where s.id=).firstordefault
    if not isnothing(adresses) then
    address = addresses.address
    city = addresses.city
    end if
    http://hgminerva.wordpress.com
    RhinoSmithUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:2
    Avatar

    --
    18 Jun 2012 05:54 AM
    Thanks for your response hgminerva. I still think in terms of pulling data from a table that all the row data would be pulled in the query and accessable on from the screen. Guess that is not the case.
    You are not authorized to post a reply.


    Latest Microsoft Visual Studio LightSwitch Forum Threads That Have Answers

    Hello everyone I encounter a difficulty with navigation between screens on the "created" method of a screen : On the method "created" of my screen "Ajouter_beneficiaire", I want to navigate to the "Liste_beneficiaires" screen in one condition.When that condition is true, then I want to navigate to the "Liste_beneficiaires", screen I get this error : "Cannot perform this action while a navigation is in progress." One more thing, when I load the "Ajouter_beneficiaire" screen, I come from the "Liste_beneficiaires" screen. Here is the code of the created method of the screen "Ajouter_beneficiaire" :  myapp.Ajouter_beneficiaire.created = function (screen) { // Write code here. var caf = confirm("Le bénéficiaire est-il titulaire CAF ?"); if (!caf) { /* Processing */ } else { var continuer = confirm("Souhaitez vous
    Read more...

    I'm compelled to Save twice when using a Details screen. I am inserting images and document as follows... 1.) Enter Password (Modal Dialog) 2.) Enter password values (PasswordBox Custom Control) 3.) OK (Command) EnterPasswordOKMethod_Execute compares password text and confirm text if both strings are the same the password text is bound to 4.) (PasswordBox Custom Control) and Modal Dialog is closed. 4.) Password text appears obfuscated in (PasswordBox Custom Control) 5.) Save is selected (and fails) 6.) LightSwitch displays an "Unable to save data" dialog with "Please correct data entry errors and try to save again." OK is selected to dismiss the Unable to save data dialog. 7.) Save is selected again and the data entered into the New Password Record Details screen is saved. ?.) (Button Custom Control) will be used to peek at password but at this time only displays a ShowMessageBox // NOTE: * I use SQL Management Studio to
    Read more...

    I have a property on a HTML screen which is set to date. It displays the date time picker in the popup but when I close the popup with a button I would like to convert the date time from the picker to text format mm/dd/yyyy and I can not seem to find the proper javascript code to convert it. Is there any examples that some one could point me to. thanks leonard
    Read more...

    I will be publishing a 3-tier SL client web application using the publish wizard.  The application uses an external sql server database; no intrinsic database tables other than for security.  My external db connection string correctly appears in the "Attached Data Sources" tab.  What I would like to do is to have LightSwitch create the application security tables in the same external database that holds the application data.  I am unclear on what I need to do to achieve this.  Do I input the connection string to the external db in the "Specify the user connection" field?  Do I check the "Publish database schema" box and add a different connection string with db administrator permissions?  The only schema elements I want from lightswitch are the security tables, so I am hoping that this will update the external db and NOT delete any existing tables.  Your guidance is
    Read more...

    Hi, I made a small Lightswitch project with a Silverlight 5 UserControl. In the UC now i need a Storyboard and a DataTrigger, so I added the assemblies: * Microsoft.Expression.Effects 5.0.5 * Microsoft.Expression.Interactions 5.0.5 * System.Windows.Interactivity 5.0.5 in the UC I have: xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ia="http://schemas.microsoft.com/expression/2010/interactions" xmlns:e="http://schemas.microsoft.com/expression/2010/effects" and I define: <i:Interaction.Triggers> <ia:DataTrigger Binding="{Binding Blink}" Comparison="Equal" Value="true"> <ia:ControlStoryboardAction Storyboard="{StaticResource StoryBoardAlertRed}"/> </ia:DataTrigger> </i:Interaction.Triggers> when I start the project I get an annoying error: translated to english it is: the attachable property
    Read more...

    1234

    Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation