Note that there are some explanatory texts on larger screens.

plurals
  1. POLINQ Entity Framework - COUNT AND QUERY
    primarykey
    data
    text
    <pre><code>edmx file: OrderData: ORDERID SHIPMENT DRIVER_ID RECEIVE_NAME </code></pre> <p>we need to build a table and print for each DRIVER_ID first column:DRIVER_ID second column: how many rows with this DRIVER_ID third column: how many rows with this DRIVER_ID and has RECEIVE_NAME not null</p> <p>please show me how it can be done...i only managed to print a getquery:(</p> <pre><code> SERVER.CS public class OrderDataRepository : BaseRepository&lt;OrderData&gt; { public class OrderDataResults { public long DriverId { get; set; } public int OrderCount { get; set; } public int OrderCountWhereNameIsNotNull { get; set; } } public class OrderViewRepository : BaseRepository&lt;OrderData&gt; { public List&lt;OrderDataResults&gt; GetOrderDataResults() { return GetQuery(). Where(x =&gt; x.SHIPMENT != null). GroupBy(o =&gt; o.DRIVER_ID). Select(g =&gt; new OrderDataResults { DriverId = g.Key, OrderCount = g.Count(), OrderCountWhereNameIsNotNull = g.Count(o =&gt; o.RECEIVE_NAME != null) }).ToList(); } } CLIENT.ASPX.CS public partial class Control : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { var rep = new OrderViewRepository(); List&lt;OrderDataResults&gt; results = GetOrderDataResults(); **Error 12 The name 'GetOrderDataResults' does not exist in the current context Error 11 The type or namespace name 'OrderDataResults' could not be found (are you missing a using directive or an assembly reference?) ** DataViewer.DataSource = results; DataViewer.DataBind(); } } WEBPAGE.ASPX &lt;form id="Form1" runat="server"&gt; &lt;asp:GridView runat="server" ID="DataViewer"&gt; &lt;/asp:GridView&gt; &lt;/form&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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