Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

export to excel problem

Status
Not open for further replies.

ganjafarmerIT

Programmer
Jun 29, 2004
30
0
0
NL
Hi folks, I'm having some weird problems with my application.

I'm retreiving data from an mssql db and then I export that data in excel format file. The problem I'm facing is that sometimes when a user opens that excel file, for some reason the data in the file is mixed with old data.
Really weird. If I look at my code it shouldn't be possible since I'm not storing anyhting in memory. I retreive the data, generate a filename each time, write the data in excel format to the file and close everything.

anyone encountered this before?

thanks in advance
 
I did have this issue once... My Dataset still had "old" data in so when I re-populated it the old data was still around thus was put into my output stream to the pdf file I was creating.

I found out that before I could run my sql query I had to do this..
Try
DataSet.Table.Rows.Clear() 'clear all rows
SqlSelect(JobID) ‘call the sql
Catch MyEx As InvalidJobTitle
Throw MyEx
End Try

Then I could repopulate the Dataset then I could do what I needed.

I hope this helps


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top