C# data access

D

douglas

I have a C#.net 2005 dataset in a desktop application does not clear out even
after I do a dispose on the object. What could cause this problem? Ho can I
empty the dataset?

I am writing a desktop windows C#.net 2005 desktop application that
generates one excel spreadsheet per unique customer. I run the dispose method
on the dataset object so that I can obtain the data for the next customer I
will populate data on the next spreadsheet. Howver when I update the data on
a new excel spreadsheet for the next customer, the data from the previous
customer appears on the spreadsheet also.
Thus can you tell me what I can do and/or what I need to check for to make
certain the data from the previous customer in the dataset is cleared out?
 
A

Alberto Poblacion

douglas said:
Thus can you tell me what I can do and/or what I need to check for to
make
certain the data from the previous customer in the dataset is cleared out?

The DataSet.Clear() method clears the DataSet of any data by removing all
rows in all tables.

Do NOT perform a Dispose() if you intend to continue accessing your DataSet
object.
 
D

douglas

"Alberto Poblacion":

I removed the displose of the datset and only used the clear method. This
solved my problem!
Thank you very much!
 

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