473,569 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sql query in real time...ajax?

Hi all,

I'm looking for a way to show my users the progress of their sql
queries. I've implemented Microsoft Ajax in order to show a progress
bar, but I would love to be able to show:

number of rows loaded vs total rows

I tried a few searches for this, but haven't come up with the right
key words I guess. Right now I have zilch. So, it's easy enough to get
a count of the total rows before starting. I guess I need to query the
datasource every .5 to 1 second and display how many rows it has
retrieved already. This way the user has some idea how long the whole
thing is going to take.

Any ideas?

Thanks in advance.

Apr 19 '07 #1
6 3276
Sound like to much effort for something small.
So far all I saw is approximations.
Like we know that on average we get 100 rows per second so if you have 1000
records will be uploaded in 10 seconds.

If user gets lucky and it ends in 9 seconds then you finish your bar early
and user happy.
If not lucky then you simply push that indicator a little back.

You should be familiar with this approach if you ever tried to Copy/Delete a
lot of files in Windows.

George.

<ma********@gma il.comwrote in message
news:11******** **************@ e65g2000hsc.goo glegroups.com.. .
Hi all,

I'm looking for a way to show my users the progress of their sql
queries. I've implemented Microsoft Ajax in order to show a progress
bar, but I would love to be able to show:

number of rows loaded vs total rows

I tried a few searches for this, but haven't come up with the right
key words I guess. Right now I have zilch. So, it's easy enough to get
a count of the total rows before starting. I guess I need to query the
datasource every .5 to 1 second and display how many rows it has
retrieved already. This way the user has some idea how long the whole
thing is going to take.

Any ideas?

Thanks in advance.

Apr 19 '07 #2
On Apr 19, 1:15 pm, "George Ter-Saakov" <gt-...@cardone.com wrote:
Sound like to much effort for something small.
So far all I saw is approximations.
Like we know that on average we get 100 rows per second so if you have 1000
records will be uploaded in 10 seconds.

If user gets lucky and it ends in 9 seconds then you finish your bar early
and user happy.
If not lucky then you simply push that indicator a little back.

You should be familiar with this approach if you ever tried to Copy/Delete a
lot of files in Windows.

George.

<mattdad...@gma il.comwrote in message

news:11******** **************@ e65g2000hsc.goo glegroups.com.. .
Hi all,
I'm looking for a way to show my users the progress of their sql
queries. I've implemented Microsoft Ajax in order to show a progress
bar, but I would love to be able to show:
number of rows loaded vs total rows
I tried a few searches for this, but haven't come up with the right
key words I guess. Right now I have zilch. So, it's easy enough to get
a count of the total rows before starting. I guess I need to query the
datasource every .5 to 1 second and display how many rows it has
retrieved already. This way the user has some idea how long the whole
thing is going to take.
Any ideas?
Thanks in advance.
Don't talk to me about Windows OS progress bars....lol.

I don't know...this seems like basically the same concept of a
download progress bar, except instead of file sizes we are looking at
a database query. Also, it is a lot of effort...the first time. After
that, it's gravy. Thanks for your time.

Apr 19 '07 #3
On Apr 19, 6:24 pm, mattdad...@gmai l.com wrote:
Hi all,

I'm looking for a way to show my users the progress of their sql
queries. I've implemented Microsoft Ajax in order to show a progress
bar, but I would love to be able to show:

number of rows loaded vs total rows
loaded where?

If you want to see a status of the SELECT...FROM query, you cannot get
it.
I think, you can have a kind of animated gif to imitate that process.
>
I tried a few searches for this, but haven't come up with the right
key words I guess. Right now I have zilch. So, it's easy enough to get
a count of the total rows before starting. I guess I need to query the
datasource every .5 to 1 second and display how many rows it has
retrieved already. This way the user has some idea how long the whole
thing is going to take.
Maybe you may need to think about paging? A more efficient way to
handle this is to use SQL Server (a server-side cursor, or can be
implemented using a SQL Server stored procedure)

Apr 19 '07 #4
Thanks for your response. There are some cases, like when my users are
exporting a report to excel that it would be cool to show them exactly
how much time and/or rows are left. So, if I bind a datasource to a
datatable, I cannot use client-side AJAX type code to read how many
rows have been added to the datatable?

I honestly don't know much about how this mechanism works, but I
thought the rows were added as they are received.

On Apr 19, 3:42 pm, Alexey Smirnov <alexey.smir... @gmail.comwrote :
On Apr 19, 6:24 pm, mattdad...@gmai l.com wrote:
Hi all,
I'm looking for a way to show my users the progress of their sql
queries. I've implemented Microsoft Ajax in order to show a progress
bar, but I would love to be able to show:
number of rows loaded vs total rows

loaded where?

If you want to see a status of the SELECT...FROM query, you cannot get
it.
I think, you can have a kind of animated gif to imitate that process.
I tried a few searches for this, but haven't come up with the right
key words I guess. Right now I have zilch. So, it's easy enough to get
a count of the total rows before starting. I guess I need to query the
datasource every .5 to 1 second and display how many rows it has
retrieved already. This way the user has some idea how long the whole
thing is going to take.

Maybe you may need to think about paging? A more efficient way to
handle this is to use SQL Server (a server-side cursor, or can be
implemented using a SQL Server stored procedure)

Apr 21 '07 #5
On Apr 22, 1:46 am, mattdad...@gmai l.com wrote:
exporting a report to excel that it would be cool to show them exactly
how much time and/or rows are left. So, if I bind a datasource to a
In this case, I think, you offer a download the file (an export).
Make a page in between as follows. It will show a "status" of the
export.

Replace the "ExportToExcel. aspx" to a name of your export page.

----------------------------------------------------------------------------------------------------------
<%@ Page Language="vb" %>
<HTML>
<HEAD>
<script language="javas cript">

var iLoopCounter = 1;
var iMaxLoop = 5;
var iIntervalId;

function BeginPageLoad() {
location.href = "ExportToExcel. aspx";
iIntervalId =
window.setInter val("iLoopCount er=UpdateProgre ss(iLoopCounter ,
iMaxLoop)", 500);
}

function EndPageLoad() {
window.clearInt erval(iInterval Id);
Progress.innerT ext = "Page Loaded -- Not Transferring";
}

function UpdateProgress( iCurrentLoopCou nter, iMaximumLoops) {

iCurrentLoopCou nter += 1;

if (iCurrentLoopCo unter <= iMaximumLoops) {
Progress.innerT ext += ".";
return iCurrentLoopCou nter;
}
else {
Progress.innerT ext = "";
return 1;
}
}
</script>
</HEAD>
<body onload="BeginPa geLoad()" onunload="EndPa geLoad()">
Loading&nbsp;- Please Wait</span<span id="Progress"> </span>
</body>
</HTML>

Apr 22 '07 #6
On Apr 22, 3:41 am, Alexey Smirnov <alexey.smir... @gmail.comwrote :
On Apr 22, 1:46 am, mattdad...@gmai l.com wrote:
exporting a report to excel that it would be cool to show them exactly
how much time and/or rows are left. So, if I bind a datasource to a

In this case, I think, you offer a download the file (an export).
Make a page in between as follows. It will show a "status" of the
export.

Replace the "ExportToExcel. aspx" to a name of your export page.

----------------------------------------------------------------------------------------------------------
<%@ Page Language="vb" %>
<HTML>
<HEAD>
<script language="javas cript">

var iLoopCounter = 1;
var iMaxLoop = 5;
var iIntervalId;

function BeginPageLoad() {
location.href = "ExportToExcel. aspx";
iIntervalId =
window.setInter val("iLoopCount er=UpdateProgre ss(iLoopCounter ,
iMaxLoop)", 500);

}

function EndPageLoad() {
window.clearInt erval(iInterval Id);
Progress.innerT ext = "Page Loaded -- Not Transferring";

}

function UpdateProgress( iCurrentLoopCou nter, iMaximumLoops) {

iCurrentLoopCou nter += 1;

if (iCurrentLoopCo unter <= iMaximumLoops) {
Progress.innerT ext += ".";
return iCurrentLoopCou nter;
}
else {
Progress.innerT ext = "";
return 1;
}}

</script>
</HEAD>
<body onload="BeginPa geLoad()" onunload="EndPa geLoad()">
Loading&nbsp;- Please Wait</span<span id="Progress"> </span>
</body>
</HTML>
Cool beans, I'll give it a shot. Thanks.

Apr 22 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
6529
by: Russ | last post by:
I'm interested in setting up a web page where live data can be displayed in real-time on the web page. For example: I would like to display a (nice looking) graph of some data value versus time and have the graph update every second without the user having to do anything like hit a refresh button. The data to plot is readily available from...
6
4829
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID SalesManName AT Alan Time
7
3754
by: Ivan Marsh | last post by:
Hey Folks, I'm having a heck of a time wrapping mind around AJAX. Anyone know of a simple, straight-forward example for pulling a simple query from mysql with PHP using AJAX? As I understand it I need a PHP script that pulls the query and dumps the data into XML format, that is called by triggering a javascript event that reads that...
9
1767
by: Leslie Coover | last post by:
http://finance.yahoo.com/ offers a wide range of financial data. Would anyone have (or know where I can get) a sample of code that
3
3281
by: SimonPlatten | last post by:
Hi, I'm a software engineer working in the offshore industry, I've been coding in various languages professionally since 1987. In my present employment I am working with control systems in the oil and gas industry. Typically control systems use process control or scada systems to display and log data from various control environments. I...
3
8715
by: user | last post by:
Hi, let's say a page loads on a browser. Without refreshing the page, multiple textboxes within the page gets real time data @ a few seconds interval. what is the logic behind to achieve this? pls advise.
5
1133
by: =?Utf-8?B?TWljaGFlbCBkZSBWZXJh?= | last post by:
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...
3
2759
by: annecarterfredi | last post by:
I was getting snapshot since the database was responding very slow...here is the query that was in a snapshot: WITH TYPEINTS ( TYPEINT, COLTYPE ) AS ( VALUES ( SMALLINT(1 ), CHAR( 'INTEGER', 8) ), ( SMALLINT (2 ), CHAR( 'SMALLINT', 8) ), ( SMALLINT(3 ), CHAR( 'BIGINT', 8) ), ( SMALLINT(4 ), CHAR( 'REAL' , 8) ), ( SMALLINT(5 ),...
3
2885
by: flashvarss | last post by:
Hi, I am making a web-based chat but to get the msg from the database i need to refresh the page and that will make load and extra bandwidth on the server so i want to make the query in real time ( only the new msg to be received without refresh the whole page ), Any one in here knows how to get data from sql database without having to...
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.