Page 1 of 1

How to Link the data to Dashboard box

Posted: Wed Oct 18, 2023 5:02 pm
by wangyonggang

How Can I Link or Set the DATA that from database SQL into box?
For example, I want to replace the below '150' number by a result of SQL view/query in SQL server DB.
More or less, looks like VB code function 'DLOOKUP('[filed]','viewoftable','WHERE condition')'.

<div class="small-box bg-info">
  <div class="inner">
    <h3>150</h3>
    <p>New Orders</p>
  </div>
  <div class="icon">
    <i class="fas fa-shopping-cart"></i>
  </div>
  <a href="#" class="small-box-footer">
    More info <i class="fas fa-arrow-circle-right"></i>
  </a>
</div>

Re: How to Link the data to Dashboard box

Posted: Thu Oct 19, 2023 6:25 am
by MichaelG

Use the ExecuteScalar function to get value from SQL.


Re: How to Link the data to Dashboard box

Posted: Thu Oct 19, 2023 11:05 am
by wangyonggang

Thanks for your reply.
Could you show me a DEMO or Sample codes?
Thanks a lot.


Re: How to Link the data to Dashboard box

Posted: Fri Oct 20, 2023 6:34 am
by MichaelG

It is simply

ExecuteScalar("SELECT Field FROM Table WHERE ...")

Re: How to Link the data to Dashboard box

Posted: Fri Oct 20, 2023 5:31 pm
by wangyonggang

IT WORKS.Thank You Very Much!

@ExecuteScalar("SQL")