using .NET ( C#) datasets properly

fguihen

Well-known member
Joined
Nov 10, 2003
Messages
248
Location
Eire
ok. i have a database with a good many tables and relationships. i have this reflected in the dataset ive created, so its an exact replica of my database. i want to be able to add a new record. does this mean that the insert command of my data adapter will be a huge command, inserting data into each of the 10 or so tables that data is entered into? ive used datasets and inserted data into one table at a time, but never more than one table. how do i do this if i have many tables to insert data into at once?
 
A dataset should map to the business process being solved not the ERD if this company is of any size. Unless this is a new company, if the ERD is modeled after a business process then a dba should be fired, if the dataset matches the ERD then the developer should be fired. A table in the database may only have 3 or 4 columns out 40 that you are interested in for youre business process. It a waste of bandwidth and memory to track those other 36 columns. Its very rare that a business process follows an ERD diagram (unless its a small project or a small/start up company) - there may be similiarities, but the more complex the company, the further from similiarities between the database ERD and dataset layout you should be.

As far as your question. If when you created the dataset you had on Update/Delete/Insert being cascading events then the insert statement for each table will be called. If you dont then, yes youll need a big ugly insert/update command.
 
If when you created the dataset you had on
Update/Delete/Insert being cascading events then the insert statement for
each table will be called. If you dont then, yes youll need a big
ugly insert/update command.

can you explain this a bit more please. my understanding is that if i have an insert command on the dataset, and set it as a cascading event( dont know how to do this) it will updatae each table that needs to be updated? can you elabourate to help my understanding? thanks
 
Back
Top