Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone!
I have the following problem:

I have a class that contains SqlDataAdapter and a
C#
SortedList <sqlcommand,string>
which contains four SqlCommands indexed by a string, for example dbCommands["select"]. I've added a property for SortedList:
C#
public SortedList<string, SqlCommand> Commands
{
    get { return this.dbCommands;  }
    set { this.dbCommands = value; }
}


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:

C#
MyClass.Commands["update"] = new SqlCommand();
/* MyClass.SqlDataAdapter.UpdateCommand is changed too */
Posted
Updated 27-Sep-10 19:19pm
v2
Comments
PumbaPumba 30-Sep-10 10:54am    
Please provide more info.

1 solution

Are you asking how to do this update within the Visual Studio Designer? http://msdn.microsoft.com/en-us/library/bb166014(VS.80).aspx Or are you asking to write the code that actually makes use of your commands within the data adapter at run-time? I think I'd try using INotifyPropertyChanged. http://msdn.microsoft.com/en-us/library/ms229614.aspx
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900