I have a table in the db called task. This table has many other tables associate with it. For example, a task has an individual associate with it, and has many resources. Many of the columns in task has codes such as language id, group id and so on.
I want to implement a class called Task. This class will be able to insert a task and all the related values in different tables. I want it to be flexible and robust enough so that I can keep added different objects to insert/update the underlying db. What kind of design pattern is best for it? Can you give me an example? thanks!
You’re asking about ORM (Object-Relational Mapping).
There’s a whole list of possibilities at Wikipedia here.
Link to SQL, Entity Framework (as noted in comments above) and SubSonic are all popular choices. The first two come included with .NET and Visual Studio in more recent versions.
Come to think of it, even Typed DataSets with Table Adapters are not too far off from what you’re looking for.