Skip to content

LINQ

LINQ (all flavours)

This category can be followed from the open social web via the handle linq-e04cf296@forum.codeproject.com

783 Topics 2.8k Posts
  • linq group by and custom aggregate

    csharp linq question
    4
    0 Votes
    4 Posts
    3 Views
    L
    By default, the elements in each grouping are untransformed input elements. I simply had to supply an element selector in the grouby. var grouped = from item in items orderby item.Group, item.Value group item.Value by item.Group into grp select new { Key = grp.Key, Concated = grp.Concat(",") };
  • 0 Votes
    2 Posts
    4 Views
    S
    In your development machine, w3wp might be running under different user account. You need to check. In “Attach to Process” window below the list of “Available Processes” there are two check boxes**.1.Show processes from all users, 2.Show processes in all sessions,** Check both check boxes.You may get the w3wp processes to attach. M.Sendilkumar
  • 0 Votes
    3 Posts
    3 Views
    S
    It is good idea.I tried.It is working for sp_pkeys stored procedure,but not for sp_fkeys.Ok! The issue is,access rights to sysinformation.If the user has enough rights to access sys ,sp_**** procs can be accessed from server explorer to LINQ to Sql DataContext designer. M.Sendilkumar
  • NullReferenceException in query

    csharp database linq com question
    3
    0 Votes
    3 Posts
    2 Views
    T
    If you watch the video the code is the same as I've posted. Is there a setting that affects initialization of strings? Todd Smith
  • VS-2008 Installation Issue

    help csharp visual-studio wpf question
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • 0 Votes
    2 Posts
    3 Views
    P
    Linq uses something called deferred execution which basically means you don't get the data until you evaluate it (in whichever way you see fit). If you want to export this as a list, you can just use crossjon_forumquestion.ToList(); to return a list. Deja View - the feeling that you've seen this post before. My blog | My articles | MoXAML PowerToys
  • 0 Votes
    3 Posts
    2 Views
    L
    that works .. thanks! i need to start reading a linq book.. looks very powerful for sure.
  • LINQ newbie question [modified]

    database question csharp linq com
    4
    0 Votes
    4 Posts
    3 Views
    P
    :-D That would do it. Sometimes crude is all you've got. Deja View - the feeling that you've seen this post before. My blog | My articles | MoXAML PowerToys
  • Can we use LINQ for MySql ?

    csharp mysql linq question
    6
    0 Votes
    6 Posts
    2 Views
    M
    Thanks Pete
  • LINQ query - issue with nested collection

    linq help question csharp database
    2
    0 Votes
    2 Posts
    3 Views
    Richard DeemingR
    Try this: var query = from critic in critics where critic.Name == "Hugo Bugo" from movie in critic.MoviesReviewed where movie.Name == "Iron Man" select movie.Vote; "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • Static DataContext

    csharp asp-net linq performance question
    4
    0 Votes
    4 Posts
    4 Views
    D
    Thanks Roger
  • LINQ to XML (where clause)

    help csharp linq xml question
    3
    0 Votes
    3 Posts
    3 Views
    F
    Thank you very much, Richard. I'd have no clue I'd have to use to 'from' clauses. Cheers. :-D
  • Sharing a DBML file across WebApplications

    csharp asp-net question discussion
    2
    0 Votes
    2 Posts
    4 Views
    P
    preetyraheja wrote: Any thoughts?????????? Yup. Separate the code so that it runs in a different tier. Make this a DLL in its own right, and you are good to go. BTW - you can convert your L2S datacontext to run as WCF, so you could just import the service references into your application. Deja View - the feeling that you've seen this post before. My blog | My articles | MoXAML PowerToys
  • grouping by more than 1 column

    csharp database linq help tutorial
    2
    0 Votes
    2 Posts
    3 Views
    B
    hi all, i got the solution.. we shud give like this.. var Fetch = from e in dc.employee join d in dc.dept on e.emp_ID equals d.emp_ID group e by new {e.emp_ID,e.empname} into g select new { EmpID = g.Key.emp_ID, Empname= g.key.empname, Total= g.Count() }; T.Balaji
  • 0 Votes
    3 Posts
    2 Views
    S
    Apologies for that - I tried to keep it as close to the orginal as possible, below is the code with correct format...please note the field values in the XML have the prefix characters taken out. The problem remains the same, I cannot add child elements belonging to Vehicles with the code in this structure and the logic I require means I need to add multiple child blocks i.e not just to Vehicles eg Buildings - any help would be appreciated! Dim \_db As New LiquidDataContext Dim \_client = From C In \_db.GetPolicyInformation("1414") Dim \_xml As New Xml.Linq.XDocument Dim \_xp As New XElement("Clients") For Each \_c In \_client \_xp.Add(<Client> <Name>\_c.Name</Name> <IDNumber>\_c.IDNumber</IDNumber> <ClientContact> <HomeTelNo>\_c.HomeTelNo</HomeTelNo> <WorkTelNo>\_c.WorkTelNo</WorkTelNo> </ClientContact> <Policy> <PolicyNumber>\_c.DisplayPolicyNo</PolicyNumber> <Balance>\_c.Balance</Balance> <InceptionDate>\_c.InceptionDate</InceptionDate> <RenewalDate>2009/05/30</RenewalDate> <Vehicles> <Vehicle> <MakeDesc>\_c.MakeDesc</MakeDesc> <Model>\_c.ModelDesc</Model> </Vehicle> </Vehicles> </Policy> </Client>) Next \_xml.Add(\_xp) \_xml.Save("C:\\Client.xml") Thanks in advance - Sean
  • Testing by Anuj

    csharp testing beta-testing
    2
    0 Votes
    2 Posts
    2 Views
    P
    It's not just C# you're testing here matey boy. My patience, which the regular denizens of the lounge will tell you is a scarcer commodity than vestal virgins at a post game frat party, has been sorely tested by you. And when I say sore, I mean headaching, ball banging, kneed in the 'nads tested. Deja View - the feeling that you've seen this post before. My blog | My articles | MoXAML PowerToys
  • linq bug ???

    csharp database linq hardware help
    2
    0 Votes
    2 Posts
    2 Views
    H
    please use pre tags when posting code... That way it might even get read! Harvey Saayman - South Africa Junior Developer .Net, C#, SQL you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer) 1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
  • prblem in where clause

    database question csharp linq
    3
    0 Votes
    3 Posts
    3 Views
    B
    hi , u can use between directly it will work like var fetch = from a in table where a.N between 0 and 10 select a; T.Balaji
  • Projection into an object that contains a list

    database help tutorial question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • query condition for a list in an object

    question csharp database linq com
    3
    0 Votes
    3 Posts
    4 Views
    A
    Thanks a lot for the suggestion. It solved my problem. Andrei