0
Reply

Dataset problem

aandrzejczyk

aandrzejczyk

Sep 24 2003 3:10 PM
1.6k
Does anyone know how to get a unique instance of a dataset? I have a piece of code that assembles report data into a datset that is used as the datasource for a crystal report that is exported to a PDF. This all works great except when multiple users hit the print button at the same time requesting the same report. The results are that the same dataset of information is exported to the two users. One user gets the correct data (I think the second one in) but the other doesn't. I have tried initializing the dataset.NameSpace to the sessionID and put an if to check that the dataset and sessionID match before I proceed but doesn't seem to fix the problem. I think when the New constructor is called, the application isn't really creating a New Object but using the existing one or a copy? Does anyone have any suggestion on how to get a unique copy each time? I have also tried DataSet.Clear and DataSet.AcceptChanges to reset the dataset once I'm finished with it. I also experimented with the dataset.dispose method but found that the garbage collection wasn't happening fast enough.