real time status

G

Guest

To all,

Not sure on how to approach this but what would be the best practice in
showing status of a query that does an aggregation or count of some sort. if
I were to have a sql statement that does select count(c1) from t1 how would I
be able to show a green, yellow or red light type object that uses my query
to determine a threshold. For example, if my count query went up to 85 then
show red, between 75 to 85 show yellow, between 65 to 75 show green on an
object that would be displayed in a VB.NET web form.

Thanks for any advice,
Michael
 
L

Luke Zhang [MSFT]

Hello Michael,

Did you execute the query with a DataCommand or DataAdapter? You may fill
the result into a dataset/datatable. And then put a Label control on the
web form. We can set the Label web control's ForeColor property on based on
result in the dataset, for example:

Label1.ForeColor =System.Drawing.Color.Red

Hope this help,

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Luke,

Thanks for the response. I can certainly can use this code but would I have
to add another control that would be used to post back and get the latest
count from my sql count query? Such as using a button to fill my dataset
again with the latest information from my count query? I would like to see
the label1 control automatically turn colors without a user having to push a
button control to populate the dataset.

Thanks for any help,
Michael
 
L

Luke Zhang [MSFT]

Hello,

Did you want the page be refreshed automatically? You may put following
line at the head of ASPX page:

<meta http-equiv="refresh" content="5" >

In this way, the page will be refreshed in every 5 seconds. And then, you
may add the code about fill the dataset and change the label in Page_Load()
method, so that they can be executed when the page is refreshed.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Thank you Luke! You are a star! Is it possible to make just the control
update every 5 seconds? I'm assuming this is where I would use ajax? Then I
would have the ajax control update five seconds.

Thanks,
Michael
 
L

Luke Zhang [MSFT]

Hello Michael,

I am not a professional of ajax, but I think it is positive that there is
an ajax control can do this. If you want to implement this with ajax, you
post this issue in

microsoft.public.dotnet.framework.aspnet

To see if some one there can help on this.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top