Get Artists and show Artist Name as string

Hi
I'm using VS2013, EF6, WPF
I have tables Media, MediaArtists, Artists
MediaArtist is a bridge table that use MediaId and ArtistId. it's mean that every Media has more Artists.
dbContext db = new dbContext();
mediumDataGrid.ItemsSource = db.Media.Select(m => new{
m.MediaId,
m.Title,
m.LastPlayedDate,
????m.MediaArtists.Select(a => Artist)????
}).ToList();
I want to get the Artists "Name" and show in gridview as Artist1, Artist2, Artist3
can you please let me know how do that?
thanks

Hello Zorig,
It seems that you are trying to perform a group by comma list in linq, if you data is not larger, you could use the LINQ2Object as below:
var result = db.X.ToList().Select(x => new { XID = x.XID, XName = x.XName, YNames = string.Join(",", x.Y.Select(y => y.XName)) }).ToList();
If data is large, you could check the workaround from Emran Hussain:
http://stackoverflow.com/a/25676673
Or to use store produce for a complex query instead.
Regards.
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.

Similar Messages

  • Hi guys i have an ipad 1 and when i plug it in to my macbook pro picasa opens up and show its name but when i open itunes i cant find the name, ive been working my head out to solve the problem please help me:(

    hi guys i have an ipad 1 and when i plug it in to my macbook pro picasa opens up and show its name but when i open itunes i cant find the name, ive been working my head out to solve the problem please help me:(

    Pay no attention to iinami, the amount of replies to people saying their handsets must have been jailbroken everytime iTunes throws out an error is tremendous. (Clearly you don't need to have any real knowledge to get to level 3 on these forums, let's hope apple's geniuses know a lot more than some of their customers.)
    http://support.apple.com/kb/TS3694
    Solution below.
    Error 9
    This error occurs when the device unexpectedly loses its USB connection with iTunes. This can occur if the device is manually disconnected during the restore process. This issue can be resolved by performing USB troubleshooting, using a different USB dock-connector cable, trying another USB port, restoring on another computer, or by eliminating conflicts from third-party security software.

  • I want to use one apple id in my macbook and iPad but i don't want pics to get sync and show in both devices, how should i stop this ?

    I want to use one apple id in my macbook and iPad but i don't want pics to get sync and show in both devices, how should i stop this ?

    Turn off My PhotoStream in iCloud on both the iPad and the Mac. PhotoStream is what shares your photos (unless you are using iCloud Photo Library Beta, in which case, all photos uploaded are accessible from all devices signed onto the same Apple/iCloud ID).
    Cheers,
    GB

  • HR iViews are not getting displayed and showing "Page can not be found".

    Hello,
    I am facing an issue in the EP 7 wherein all the standard HR iViews are not getting displayed and showing "Page can not be found".
    We have added S_SERVICE autorisation object to user used for the relative JCO as well by looking at other similar forums but that did not help.
    I have attached last part of log from file application.log under "F:\usr\sap\EP1\JC01\j2ee\cluster\server0\log"
    #0002A537D2A6006A0000027300001C4C00046E3590936E5F#1247076244733#/Applications/WebApplications#sap.com/irj#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Administrator#12374##n/a##b7291b106be911de8d8a0002a537d2a6#SAPEngine_Application_Thread[impl:3]_27##0#0#Info#1#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Plain###application [irj] prt: init#
    #1.5 #0002A537D2A6007A0000001200001C4C00046E35AAA74D33#1247076682222#/Applications/WebApplications##com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Guest#0##n/a##cf997d306af811dec69d0002a537d2a6#Thread[Finalizer,8,system]##0#0#Info#1#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Plain###application [irj] prt: destroy#
    #1.5 #0002A537D2A6005F0000026C00001C4C00046E35C2814813#1247077082383#/Applications/WebApplications#sap.com/irj#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#SKhatkale#12460##n/a##a7cb51e06beb11de8bd70002a537d2a6#SAPEngine_Application_Thread[impl:3]_6##0#0#Info#1#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Plain###application [irj] prt: init#
    #1.5 #0002A537D2A60075000002BD00001C4C00046E35C3AD4359#1247077102039#/Applications/Xss#sap.com/tcwddispwda#com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent#SKhatkale#12464##rrisep1p01_EP1_14481150#SKhatkale#b6d348006beb11deb9780002a537d2a6#SAPEngine_Application_Thread[impl:3]_31##0#0#Fatal#1#com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent#Plain###You do not have the authorization to start service sap.com/pcui_gp~xssutils/XssMenu.#
    #1.5 #0002A537D2A6007A0000001300001C4C00046E35DDE07029#1247077541575#/Applications/WebApplications##com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Guest#0##n/a##cf997d306af811dec69d0002a537d2a6#Thread[Finalizer,8,system]##0#0#Info#1#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Plain###application [irj] prt: destroy#
    #1.5 #0002A537D2A600650000024600001C4C00046E36B6DBE4D0#1247081181950#/Applications/WebApplications#sap.com/irj#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Administrator#12873##n/a##37e186606bf511de8bf20002a537d2a6#SAPEngine_Application_Thread[impl:3]_0##0#0#Info#1#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Plain###application [irj] prt: init#
    Please let me know if anybody has come across such scenario before.
    Thanks
    Suhas
    Edited by: Suhas Khatkale on Jul 8, 2009 10:09 PM

    Hi,
    This issue is now resolved. We followed up with SAP and they suggested to update the component EP-PSERV to latest patch which was earlier to patch 1. Later on we upgraded it to patch 4 and this resolved the issue.
    Thanks
    Suhas

  • I'm giving my iphone 4 to my sister. How do I get it to show her name instead of mine?

    I'm giving my iphone 4s to my sister.  How do I get it to show her name instead of mine?

    What to do before selling or giving away your iPhone, iPad, or iPod touch

  • How do I fix my problem with Artist and Sort Artist?

    I have all my songs sorted by Artist and because I have songs that feature other artists I use the sort artist field.
    In itunes it all looks fine but when I sync it with my iPod Nano 5th Gen one of the artists names comes up as the artist for all songs.
    Eg. I have 5 B.o.B songs.The Artist field has B.o.B and the featured artist so it looks like -B.o.B feat. Hayley Williams-. The sort artist field along with album artist and sort album artist field are all only B.o.B.
    My problem is that when I sync them onto my iPod all the songs by B.o.B appear under B.o.B feat. Rivers Cumo when I sort by Artist despite this only being the artist for one and all listed with the same format as above. They all also come up with the Artist as B.o.B feat. River Cumo when I play one of the songs.
    Is there anyway to fix this so on my iPod they all appear under B.o.B when sorting by Artist but when I play the song it gives me the artist name? I'd prefer not to have to put the featured artist in the song title.

    This sometimes happens if your MacBook battery is swollen, and pushes on the underside of the trackpad.
    Some users forgot that an alternate input device, like a tablet, does not shut off when set aside -- it continues to provide input at the same time as the mouse you put your hand on.

  • How to get property and show itself in the Operator interface

    Hello, I suppose it's simple but I don't know to do.
    With Labview opertor interface, I would like to get a property of a step, for example the serial number or a local variable, and show its value in an labview indicator. Only that.
    Thanks.

    Hi,
    You can use UIMessages. See http://zone.ni.com/devzone/cda/tut/p/id/4532
    Example show you how to for TS 3.0 or greater
    Regards
    Tom Andres Lomsdalen, CTD

  • How To : Get subdirectories and show them in a JList()

    Hello again ..
    Some of you might have noticed it: I already had a question yesterday.
    Today it's a problem of the same kind. This time there are Dukes assigned to it !
    The problem :
    - I'm pretty new to Java ( following a course @ school for 2 months now)
    - I'm working on an application that gives me a view of all the movies I have in a directory.
    What I want : My application has to search in that directory ( "D:\\Movies\" ) and display the name of each subdirectory in a JList()
    (don't forget that I need the full path saved somwhere so that I can open it later. Why? So that I can watch the movie by just clicking on a button)
    What I do now is: Fill a Db with all the details and then put it into a JList --> .equals("NOT THE BEST WAY ME THINKS");
    Any ideas/tutorials ...
    Thanks

    I told you I would read it later but I forgot :X
    I've read it now ... and to create the list I just use this :
    public String[] setListTitles()
              File directory = new File("D:\\Movies\\");
              if(!directory.exists())
                   return null;
              return directory.list();
         }I'm also using a JFileChooser someone recommended me on this forum. First time I use this and it causes problems hehe
    public void chooseDirectory()
              JFileChooser chooser = new JFileChooser();
              chooser.setDialogTitle("Choose The Directory That Conatains The Movies");
              chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
              chooser.showOpenDialog(this);
              System.out.println(chooser.getCurrentDirectory());
         }I've learned all methods of that class and ... when I select for example : D:\Movies\ ---> It prints D:\
    What am I doing wrong AGAIN?
    Thanks

  • How to get JDeveloper to show package names?

    Hi all,
    Newbie question. I have Java classes organized in different packages, but in the left panel where the classes are shown, the package names are not shown to display which class belongs in which package. Is there an option I can set to get JDeveloper to show the package names? I'm using 9.0.3. Thanks.
    Henry

    There's a yellow button with 'Show categories' tooltip. This should work fine.

  • Difference between "Artist" and "Album Artist"?

    Hi
    I'm wondering why in the iTunes browser there is a field for "Album Artist" and a field for "Artist"?
    Aren't they referring to the same thing?
    Thank you.

    No. Some albums have various artists. For example, I have +Satin Doll: Smooth Jazz Plays Duke Ellington+. For album artist, I have "Various," but for each song I have the primary performer of that song as the artist. Album views come up Various, while songs come up with the artist. It's good for grouping tracks. Also, some people like to included featured guests in the Artist field, but having the Album Artist consistent helps with various views in iTunes and on the iPod.

  • Snow Leopard / Mail -- mail keeps getting redownloaded and shows as new mai

    Hi.
    Anyone had this problem? After I upgraded (?) to Snow Leopard, Mail.app now redownloads my mail from multiple IMAP and POP accounts and shows it as new.
    This happens at times I cannot predict. I don't see a pattern to when this happens. I can't predict when it will happen.
    So at seemingly random times, Mail suddenly shows that I have 400 unread e-mails. Even though these are e-mails I've already dealt with.
    Anyone see this before?
    Anyone have a solution?
    Thanks in advance.
    Amy

    Hi 1badger13.
    Please read his link. It's a bug that Apple by should be aware of now!
    http://discussions.apple.com/thread.jspa?threadID=2133249&tstart=0
    Regards from
    Simba

  • How do I get Messages to show contact names instead of phone numbers in notifications?

    Originally, notifications from Messages.app would show the contact name sending the message. I'm not sure what caused it to stop, but now all notifications show up as the phone number of the contact. In the actual app, the names look fine. Is there some way to get contact names to show up again?

    Hi,
    Depending if you are using Buddy Lists or not then this setting is supposed to be fro the Budfdy lists but will effect the Main Window display
    This item lower in the same View Menu is supposed to be the one fro the main Messages window (it has to be the "Front" window)
    As you can see it also controls what Messages style is used.
    7:54 pm      Tuesday; June 24, 2014
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • My iphone is getting stuck and showing lines running on the bott

    I m using iphone 4s,ios 7.1.2. I m unable to diagnose a problem having on my iphone. Some times when i m using a browser(chrome,safari) it suddenly get stuck e.g while writing a website name,on any specific letter it get stucks. And phone doesnot accept any command..even when i press home key it doesnot show homescreen.After this i hard reset my iphone using home and lock key.Then when my iphone get started again,there i watch some flickering/lines running across the bottom side of my iphone screen and after 10-15 mins they disappear and phone works normally..By looking upon this situation i back up my iphone on itunes and then reset it and updated my ios to 7.1.2 from older 7.1.1 and then restored back up.But this problem still persist and there is no improvement after updating to the newer version of ios and resetting. Please some one kindly tell me that what problem is my iphone is running from? Is there any software issue or hardware? Or some application is disturbing?

    I did that many times, I mean I do it everytime. But it doesnt seem to help. It is strange sometimes the phone is slow and stucks for a many seconds, sometimes it is just one or two seconds. Thank you for your help though, but is there something else that you could think of?

  • Sort address book (and show) company names

    Hi all,
    I would like to be able to do the following in Address book. Any help/suggestions would be most appreciated:
    1) Display a contacts First/Last name and the company they work for in the list of names
    2) Sort the list of contacts by company they work for
    The reason I want to do this is so that for our media list we can put in the individual PR contacts names, email address and blog, website etc they work for and then be able to quickly see this information without having to click on each one. It will also speed up dragging multiple contacts to one email.
    I realise that you can use groups to do this but it seems somewhat pointless to have one group per blog sometimes with only one contact in it and anyway why bother having the company info in the first place.
    It does seem somewhat strange that the list view cannot at least show some pertinent info about each contact without having to click on them...

    you should back up your whole system not just those two files. then you'll never miss anything. what's your backup setup?
    the address book data is stored in home directory/library/application support/address book and the ical data in home directory/library/calendars.

  • VM cannot get IP and shows host MAC in event logs

    I have a strange issue where the VM on a user's laptop worked fine in the office with a Wireless NIC but when he got home we began having some problems (no network in the VM, only get 169.x.x.x IP in the VM, host network connection drops when we try
    to access or configure the networking inside the VM).
    Here is what I know so far:
    Bridge exists on host (wireless NIC to virtual NIC) and is enabled
    Adapter in VM has MAC of 00-15-5D-0A-A5-00, cannot get IP
    VM settings for the wireless NIC show the MAC is Dynamic and the one assigned is within the range setup on the Virtual Switch
    Adapter on host has MAC of 9C-4E-36-AC-83-68, gets IP of 192.168.0.14
    In the VM, you cannot renew or assign an IP, it says the MAC exists on the network and has an address assigned.  Network connectivity also drops if you try to renew the IP
    In the system event logs on the VM, I see TCPIP event 4199, exact message is - The system detected an address conflict for IP address 192.168.0.14 with the system having hardware address 9C-4E-36-AC-83-68.
    There are no errors in the event logs on the host.
    Deleting the NIC inside the VM and removing/re-adding it to the VM settings does not resolve it
    Deleting and recreating the virtual switch does not resolve it
    The option to allow the management OS to also use the wireless NIC is enabled on the virtual switch.
    The wired connection also worked in our office during the build and testing but he doesn't not have a cable at home for me to test the wired there.
    We have another machine which is configured the same way and is working correctly, both in the office and offsite.
    Why is the VM trying to use the host MAC to get an IP, shouldn't it be using the one assigned by Hyper-V?  Could this be an issue with his home office network or maybe specifically with his WAP?  What other items could cause this?
    I have asked my user to go connect to a wireless network in a different location and test it but I haven't heard back from him yet.
    Thanks in advance for any suggestions.

    Hi Milos,
    1 - Unfortunately I can't test this, the router is supplied by his ISP and is not one that we have any management capabilities on.
    2 - Any time I access network information in the VM (even just to run "ipconfig /all" at a command line), the network drops temporarily on the host and I loose access to it.
    3 - I've not used this before, I'll check it out.
    It seemed really odd to me that the VM showed the host MAC in the event logs when everything else in the VM shows the one assigned by Hyper-V.
    Do you know if the "Virtual Networking and Wireless network adapters" entry in Ben Armstrong's Virtualization blog still applies in Windows 8.1?  It won't let me post the link to it directly, sorry.
    I've seen it referred to recent posts but it's from 2005.
    It makes sense if it is since symptom #2 sounds like what I am seeing.

Maybe you are looking for

  • Premiere Pro CC 14 won't quit or open projects

    Hi- Here is my situation.  My HD crashed in my iMac last week and it has been replaced by Apple.  I've now reinstalled all of my apps.  Everything seems to be working fine except for Premiere.  I can open Premiere, open a project and it loads fine. 

  • Capture Problem - No Video-Audio only TC

    Hello, I haven't had this problem before, and I've done a search on this forum. But none of the solutions that seemed to have worked for other posters has worked for me. So here we go..... I'm using OS 10.4.11, QT 7.4.1, FCP 6.0.2 on a Dual 2.5GHz G5

  • FS10N balance not tie with FBl3N line item totals

    Hi I searched the forum for posting on FS10N and FBL3N incorrect balances and I did not any post appropriate for my issue. Hence I am posting my issue here. For a particular month, say 072010, FS10N GL balance does not tie with FBL3N line item totals

  • Strange clients cant talk to OD master problem

    Hi, I'm running here into a really strange behavior of my OD clients, maybe you can help me to find out whats going on. I have an 10.4 OD master running and multiple clients connecting to it. On the clients I did a bind to the OD. I didn't get an err

  • On some tools in elements 9 I se 3 pointers when i go to the editing screen  pls advise txs

    With some tools in elemnts 9 I see three pointers side by side  on the edit screen Windows 7 Please advise txs