开发者

Getting column names from oldValues IOrderedDictionary

开发者 https://www.devze.com 2022-12-14 05:46 出处:网络
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 defa

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 th开发者_如何学JAVAe .key field but that cast is not allowed.

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

Cheers! :D


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;
0

精彩评论

暂无评论...
验证码 换一张
取 消