何在collection和DataAdapter属性之间添加同步

何在collection和DataAdapter属性之间添加同步

本文介绍了如何在collection和DataAdapter属性之间添加同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!
我有以下问题:

我有一个包含SqlDataAdapter

Hi everyone!
I have the following problem:

I have a class that contains SqlDataAdapter and a

SortedList <sqlcommand,string>

的类,该类包含四个由字符串索引的SqlCommand,例如dbCommands["select"].我为SortedList添加了一个属性:

which contains four SqlCommands indexed by a string, for example dbCommands["select"]. I''ve added a property for SortedList:

public SortedList<string, SqlCommand> Commands
{
    get { return this.dbCommands;  }
    set { this.dbCommands = value; }
}



如何在此SortedList和DataAdapter之间添加同步,例如,当更改SortedList值中的任何一个时,此更改应反映在DataAdapter.XXXCommand中,如下所示:



How do I add a sync between this SortedList and DataAdapter, for example, when any of SortedList values is changed this change should reflect in DataAdapter.XXXCommand, like this:

MyClass.Commands["update"] = new SqlCommand();
/* MyClass.SqlDataAdapter.UpdateCommand is changed too */

推荐答案


这篇关于如何在collection和DataAdapter属性之间添加同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 09:19