update datatable in a dataset in ADO.NET 2.0

I have an application in VS2005 winforms C#.
I have a dataset with a datatable. I updated some records in the datatable. (not add just update)
I want to create a collection of these changed records . I would also like to see some examples on this issue.
Thankyou
Anat
ANAT2403Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
check out the Dataset.GetChanges method, which returns a DataSet with only those rows that have changes:
http://support.microsoft.com/kb/313485

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ggkumareshCommented:
Hi,

  Try this....


private void UpdateDataSet(DataSet myDataSet){
     if(!myDataSet.HasChanges(DataRowState.Modified))

        return;
   DataSet xDataSet;

//To get modified row only
      xDataSet = myDataSet.GetChanges(DataRowState.Modified);

      if(xDataSet.HasErrors){
      // Insert code to resolve errors.
   }
   myOleDbDataAdapter.Update(xDataSet);
}
 



ANAT2403Author Commented:
Hi,
It doesnot work.
I have a dataset and a datatable dt1.
I create a new datatable dt2 :  dt2 = new dt1();
I edit and change a record in dt2.
The command   myDataSet.HasChanges(DataRowState.Modified) return false.
Hoe do I do it?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
>I edit and change a record in dt2.
how?
ANAT2403Author Commented:
     this is how:  
   DataRow dr;
            dr = dt2.Rows.Find(keyIDStr);
            dr.BeginEdit();
            dr["ManufacturerID"] = ChangedValue;
           dr.EndEdit();
Anat
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>The command   myDataSet.HasChanges(DataRowState.Modified) return false.
actually, the method HasChanges returns a DataSet, and not a boolean?!
ANAT2403Author Commented:
I am looking for command on a datatable or a view about the changes. not command on the dataset.
Anat
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.