Thoughts from Dan Miser RSS 2.0
 Tuesday, July 06, 2004
In order to find out all of the columns that have been changed in a DataSet, you need to resort to code similar to the following. I sure liked the way MIDAS/DataSnap handled this better. A simple call to NewValue, and off you go. Another thing to keep in mind, DataRowVersion.Proposed is only valid between BeginEdit()/EndEdit() calls, so you are forced to write code like this instead:

      if (!dataSet1.HasChanges())
        return;

      DataSet ds = dataSet1.GetChanges();
      foreach (DataTable tbl in ds.Tables)
      {
        foreach (DataRow dr in tbl.Rows)
        {
          for (int i=0; i < tbl.Columns.Count; i++)
          {
            if (dr[i, DataRowVersion.Current] != null && !dr[i, DataRowVersion.Current].Equals(dr[i, DataRowVersion.Original]))
              textBox1.AppendText(tbl.TableName + "." + tbl.Columns[i].ColumnName + " changed (" + dr[i, DataRowVersion.Original] + " -> " + dr[i, DataRowVersion.Current] + ")" + Environment.NewLine);
          }
        }
      }
Tuesday, July 06, 2004 1:04:00 PM (Central Standard Time, UTC-06:00)  #    Comments [2] -
.NET
Tracked by:
http://9nb-information.info/88366778/index.html [Pingback]
http://9ny-information.info/08768364/northridge-high-school-knights.html [Pingback]
http://9nn-information.info/59555846/index.html [Pingback]
http://9nc-information.info/92618909/business-management-work-career-home-nation... [Pingback]
http://9np-information.info/08487909/nj-auto-requirements.html [Pingback]
http://9nx-information.info/56745078/city-of-shreveport-la.html [Pingback]
http://9nt-information.info/72836652/index.html [Pingback]
http://9nb-information.info/56087916/index.html [Pingback]
http://9nj-information.info/79716781/equipment-for-a-drum-set.html [Pingback]
http://9od-information.info/85820643/index.html [Pingback]
http://9qc-information.info/26379880/jennifer-sklias-gahan.html [Pingback]
http://9ox-information.info/99854039/index.html [Pingback]
http://9ou-information.info/61832713/fat-tire-kits.html [Pingback]
http://9ov-information.info/66104005/index.html [Pingback]
http://9of-information.info/91525541/index.html [Pingback]
http://9qn-information.info/38778234/index.html [Pingback]
http://9ru-information.info/63439002/index.html [Pingback]
http://9sd-information.info/67181533/index.html [Pingback]
http://9sm-information.info/93818516/porte-versailles.html [Pingback]
http://9rk-information.info/33194323/motorcycle-engine-car.html [Pingback]
http://9ry-information.info/54744091/index.html [Pingback]
http://9se-information.info/26217874/ulcerosa.html [Pingback]
http://9uaep-le-informazioni.info/76669837/ace-brain.html [Pingback]
http://9uaft-le-informazioni.info/95361114/annuncio-cane-piccola-taglia.html [Pingback]
http://9uafe-le-informazioni.info/90443035/index.html [Pingback]
http://9uaet-le-informazioni.info/94697309/index.html [Pingback]
http://9uaeg-le-informazioni.info/01372859/index.html [Pingback]
http://9uaej-le-informazioni.info/09307033/ferrino-tenda-4-posto.html [Pingback]
http://9uaeh-le-informazioni.info/81729202/venditore-automobile.html [Pingback]
http://9uafm-le-informazioni.info/71645154/hippocampus-it.html [Pingback]
http://9uaei-le-informazioni.info/25564648/micael-buble.html [Pingback]
http://9uafa-le-informazioni.info/68735607/index.html [Pingback]
http://9uagl-le-informazioni.info/25061960/problema-digital-mp4-player-cinese.ht... [Pingback]
http://9uagd-le-informazioni.info/48394216/index.html [Pingback]
http://9uahm-le-informazioni.info/79300411/uhttp-www-telecom-italia-it.html [Pingback]
http://9uags-le-informazioni.info/85887825/di-fronte.html [Pingback]
http://9uahs-le-informazioni.info/01158135/unione-industriale-caserta-it.html [Pingback]
http://9uaga-le-informazioni.info/12756024/dracma-srl-brescia.html [Pingback]
http://9uahn-le-informazioni.info/43780764/index.html [Pingback]
http://9uaht-le-informazioni.info/16730415/stemma-foggia-calcio.html [Pingback]
Navigation
Archive
<October 2008>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Dan Miser
Sign In
Statistics
Total Posts: 310
This Year: 25
This Month: 1
This Week: 0
Comments: 605
All Content © 2008, Dan Miser
DasBlog theme 'Business' created by Christoph De Baene (delarou)