Dataset Object updating

T

tshad

Is there a way to update a DataSet Object?

I have a Dataset Object (DataSetObj.Tables(0) - one table) that I read in
from a .csv file.

I normally do the following to get my data from the .csv:

DataSet DataSetObj As New DataSet;
DataTable DTDepartment As New DataTable;
DataTable dt As New DataTable;

OleDbDataAdapter da As New OleDb.OleDbDataAdapter("Select * from " +
"temp.csv", conn);
da.Fill(DataSetObj);

I can get some rows by doing the following:

drCollection = DataSetObj.Tables[1].Select("F1 = 'FRANK'");

Is there a way to Update the tables inside the Dataset?

For example: I would like to change the all the values in Column 1 to 1084
if Column 4 = 'Retirement' and change all the values to 5300 if Column 4 =
'Medicare Employer' etc.

I would then read the file and output it to another .csv file.

Thanks,

Tom
 
G

Guest

You can certainly update, delete or insert rows in any table of a DataSet,
and then use its WriteXml method (or some other techique) to persist the
revised data to a file.
Peter
 

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