Saturday, March 24, 2012

The DataSet: I have doubts

Here are my doubts about the dataSet object. These doubts may arise from my not understanding this object properly so please let me know if this is the case.

i see these problems:

1. if a user closes the page mid session i lose my in memory dataSet so all the dataGrid editing my user has done since the database was last updated is lost.

2. when updating the parent database I need to fill the dataAdapter first in case anyone else has edited the rows beforehand. all this toing and froing is expensive.

Also, how do i decide to update the parent database from the dataSet. Can I do it automatically i.e. on a timer or do I do it after every 5 dataGrid row edits?

thanks.1. You would lose any data had you hand written the text boxes and filled the table dynamically with them. It's not the fault of the DataSet or some weird communication.

2. Again, you should be checking data validity before hand any way. The only difference here, with DataGrids, is that you know exactly which row was modified before hand very easily.

3. [How do I...] Why not whenever the user presses update? The few times that I have used datasets I have never held them in the session. I bind them to a datagrid and forget. When the user edits, the info I need to update the row is right there.

0 comments:

Post a Comment