Note that there are some explanatory texts on larger screens.

plurals
  1. POcombining between scripts
    primarykey
    data
    text
    <pre><code>DriverId OrderCount OrderCountWhereNameIsNotNull 12 2 2 13 1 1 </code></pre> <p>this is the current table wich being made by this code:</p> <pre><code> public partial class Control : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { OrderDataRepository rep = new OrderDataRepository(); var results = rep.GetAllOrderData(). GroupBy(o =&gt; o.DRIVER_ID). Select(g =&gt; new { DriverId = g.Key, OrderCount = g.Count(), OrderCountWhereNameIsNotNull = g.Count(o =&gt; o.RECEIVE_NAME != null) }).ToList(); DataViewer.DataSource = results; DataViewer.DataBind(); } } </code></pre> <p>instead of the table i need to take and print for each DriverId a progress bar as in this script:</p> <pre><code> int OrderCount, OrderCountWhereNameIsNotNull; System.Web.UI.WebControls.TableRow oRow; System.Web.UI.WebControls.TableCell oCell; System.Web.UI.HtmlControls.HtmlGenericControl oDiv; while (true) //loop through records //do while not eof { oRow = new System.Web.UI.WebControls.TableRow(); oCell = new System.Web.UI.WebControls.TableCell(); oDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV"); OrderCount = 200; //get value from DB, convert to meaningful width OrderCountWhereNameIsNotNull = 100; //get value from DB, convert to meaningful width oDiv.InnerHtml = "&lt;div style='border: 3px solid black; width: " + OrderCount + "px;'&gt;"; oDiv.InnerHtml += Environment.NewLine + " &lt;div style='border: 0px; background-color: red; width: " + OrderCountWhereNameIsNotNull + "px;'&gt;&amp;nbsp;&lt;/div&gt;"; oDiv.InnerHtml += Environment.NewLine + "&lt;/div&gt;"; oCell.Controls.Add(oDiv); oRow.Cells.Add(oCell); tblData.Rows.Add(oRow); } </code></pre> <p><strong>i cannot combine them, may be the script is not good...please help</strong></p> <p>at the moment my main page is:</p> <pre><code>&lt;form id="Form1" runat="server"&gt; &lt;asp:GridView runat="server" ID="DataViewer"&gt; &lt;/asp:GridView&gt; &lt;/form&gt; </code></pre> <p><img src="https://i.stack.imgur.com/JA5PJ.jpg" alt="enter image description here"></p>
    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.
 

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