Datasource queried twice

R

richi

Hello

I stumbled upon articles detailing my problem but have yet to find a
solution so I'm hoping that somebody at Microsoft can help.

I have a OWC11 Pivot table which is populated using XML created by an
HTTPHandler. The problem is the SQL Server database is queried twice as the
handler is fired twice.

This obviously increases the time to server up the page and I would like to
avoid the 2nd trip to the database.

I am using the following code to populate the pivot table.

document.frmSpendPivot.pt.ConnectionString = "provider=mspersist.1"
document.frmSpendPivot.pt.CommandText = "GetPivotData.aspx"

Any help would be greatly appreciated!!

Many thanks in anticipation

R
 
A

Alvin Bruney [Microsoft MVP]

I believe the connection line does fire another request. You may need to
have the handler maintain state so you can avoid the second request. Use a
flag or something.

--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
 
R

richi

Thanks Alvin

I tried what you suggested and set a flag so that the Handler one ignore the
second request to query the database and export the dataset to XML, however,
this produced all manner of errors about streams and e_fail status errors.

So it seems that it must query the database twice but this seems ridiculous
if this is by design. Could you suggest a way round it or does anybody know
why this happens.

Thanks in anticipation

R

Alvin Bruney said:
I believe the connection line does fire another request. You may need to
have the handler maintain state so you can avoid the second request. Use a
flag or something.

--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
--------------------------------------------------


richi said:
Hello

I stumbled upon articles detailing my problem but have yet to find a
solution so I'm hoping that somebody at Microsoft can help.

I have a OWC11 Pivot table which is populated using XML created by an
HTTPHandler. The problem is the SQL Server database is queried twice as
the
handler is fired twice.

This obviously increases the time to server up the page and I would like
to
avoid the 2nd trip to the database.

I am using the following code to populate the pivot table.

document.frmSpendPivot.pt.ConnectionString = "provider=mspersist.1"
document.frmSpendPivot.pt.CommandText = "GetPivotData.aspx"

Any help would be greatly appreciated!!

Many thanks in anticipation

R
 

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

Similar Threads


Top