Note that there are some explanatory texts on larger screens.

plurals
  1. POorder results of linq query by multiple items
    text
    copied!<p>using the following query</p> <pre><code> Dim allEvents As New List(Of Events) Dim digits = "1 2 3 4 5 6 7 8 9 0".Split() Dim results = (From t In ctx.events Where t.date = todaysdate.Date AndAlso Not digits.Any(Function(d) (t.symbol.Contains(d))) Order By t.time Select New With { t.symbol, t.date, t.time, t.description, t.domestic_call_num, t.web_url}) If results.Count &gt; 0 Then For x As Integer = 0 To results.Count - 1 Dim newevent As New Events With newevent .CompanySymbol = results(x).symbol .EventDate = results(x).date .EventTime = Left(results(x).time.ToString(), 5) .EventDescription = results(x).description If results(x).domestic_call_num IsNot Nothing Then .DialInNumber = results(x).domestic_call_num Else .DialInNumber = "" End If If results(x).web_url IsNot Nothing Then .WebCastUrl = results(x).web_url Else .WebCastUrl = "" End If End With allEvents.Add(newevent) Next Return allEvents </code></pre> <p>I get the results I want, but i'd like to further order them by description and time</p> <p>I tried the following, which should have worked</p> <pre><code> Dim results = (From t In ctx.events Where t.date = todaysdate.Date AndAlso Not digits.Any(Function(d) (t.symbol.Contains(d))) Order By t.time Group By t.description Select New With { t.symbol, t.date, t.time, t.description, t.domestic_call_num, t.web_url}) </code></pre> <p>I also tried ThenBy which the compiler didnt like. Any help on how to accomplish this would be appreciated. Essentially I want a sort order of time then description then symbol.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload