views:

129

answers:

1

Hi,

I understand that the oldValues property of FormViewUpdatedEventArgs contains field name/value pairs for an update. I can certainly access the values using for example e.OldValues(x) - because the default member has been declared in the system.. but how can I pull out the column/field name in this case?

I've tried casting oldValues(x) as a dictionaryentry - with a view to pulling the .key field but that cast is not allowed.

I guess I'm missing something fundamental here - any pointers, please?

Cheers! :D

A: 

Try this:

                    ICollection colKeys = e.OldValues.Keys;
                    ICollection colValues = e.OldValues.Values;

                    string keys = string.Empty;
                    string values = string.Empty;

                    foreach (object obj in colKeys)
                    {
                        keys += obj.ToString() + "|";
                    }

                    foreach (object obj in colValues)
                    {
                        values += obj.ToString() + "|";
                    }

You may need the following imports:

using System.Collections;
using System.Collections.Specialized;
YPG