Problem with OLE DB Provider

P

Pranav Nabar

Hi,
I am working on an ASP.NET application. From a page, I am triggering export
of a large dataset into an Excel file using OLE DB Provider and after the
export is complete the user is redirected to the excel file. Note that the
operations here are synchronous. The problem is the data exported is not
getting written out to the disk before the user is redirected. So I get an
empty excel file in IE while if I check the actual file on the disk, the
data seems to be there after a lag of a few seconds.

From the KB article, I learnt I cannot set the Max Buffer Size property in
OLE DB cannot be set in ADO.NET. How do I ensure that the data is flushed to
the disk before I redirect the user to the file?

Thanks in advance,
Pranav
 
P

Pranav Nabar

Yes Miha. I close the connection immediately after exporting and before
redirecting. This does not happen on every machine. It is happening on our
production setup which is a high-end multiproc machine.

I got the feeling that the disk-write was being done asynchronously after/in
the connection close. One thing to note here is that larger the data
exported, more is the probably of finding hitting the problem (as expected).
At present we have add a Thread.sleep of 10 secs between the export and the
redirecting steps. However, with this we have merely succeeded in raising
the threshold data size for the export is successful. We would like a better
and assured solution.

Thanks,

-pranav

Miha Markic said:
Hi Pranav,

Huh, weird.
Do you close the connection after exporting?

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

Pranav Nabar said:
Hi,
I am working on an ASP.NET application. From a page, I am triggering export
of a large dataset into an Excel file using OLE DB Provider and after the
export is complete the user is redirected to the excel file. Note that the
operations here are synchronous. The problem is the data exported is not
getting written out to the disk before the user is redirected. So I get an
empty excel file in IE while if I check the actual file on the disk, the
data seems to be there after a lag of a few seconds.

From the KB article, I learnt I cannot set the Max Buffer Size property in
OLE DB cannot be set in ADO.NET. How do I ensure that the data is
flushed
to
the disk before I redirect the user to the file?

Thanks in advance,
Pranav
 

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