Click here to Skip to main content
15,900,468 members
Home / Discussions / Database
   

Database

 
GeneralRe: backing up/moving mssql databases Pin
Mike Dimmick3-Oct-03 6:30
Mike Dimmick3-Oct-03 6:30 
GeneralRe: backing up/moving mssql databases Pin
djkno33-Oct-03 6:38
djkno33-Oct-03 6:38 
GeneralRe: backing up/moving mssql databases Pin
djkno36-Oct-03 8:11
djkno36-Oct-03 8:11 
GeneralRe: backing up/moving mssql databases Pin
Mike Dimmick6-Oct-03 23:20
Mike Dimmick6-Oct-03 23:20 
GeneralRe: backing up/moving mssql databases Pin
djkno37-Oct-03 4:18
djkno37-Oct-03 4:18 
GeneralRe: backing up/moving mssql databases Pin
Mike Dimmick7-Oct-03 22:39
Mike Dimmick7-Oct-03 22:39 
GeneralSqlDataAdapter.Update sometimes does not update Pin
james-cxx2-Oct-03 10:55
james-cxx2-Oct-03 10:55 
GeneralRe: SqlDataAdapter.Update sometimes does not update Pin
james-cxx14-Oct-03 18:18
james-cxx14-Oct-03 18:18 
So I'm happy to report the problem was with my code and not with the .NET SqlDataAdapter. But I think the circumstances of the problem bear repeating so that others might avoid it.

Form A creates some SqlDataAdapters that fill a dataset and periodically refreshes it. At some point, due to user interaction, an instance of "Form B" is created and passed a reference to the SqlDataAdapters. Form B then finds a DataRow in one of the tables of the dataset, does some work on it, and then calls SqlDataAdapter.Update to put the changed DataRow in the database. And this worked _most_ of the time, but occasionally it would not - no data would be updated to the database.

It turns out that during Form A's periodic update, it would clear the datatable and the refill it. This process would cause Form B's datarow it was working on to get to a state of DataRowState.Detached. Since the DataRow was now detached, when form B would call SqlDataAdapter.Update, the info from the row would not go to the database because the DataRow is not associated with the DataSet that the adapter was working with. And there was no error to be reported in this circumstance.

So the moral of the story is this: Beware what's happening to your DataSet or DataTables while working with a DataRow. And it doesn't hurt to make sure the row hasn't somehow become detatched when you weren't watching.




-- James --
GeneralLogic Pin
Anonymous2-Oct-03 3:58
Anonymous2-Oct-03 3:58 
GeneralRe: Logic Pin
Mike Dimmick2-Oct-03 12:14
Mike Dimmick2-Oct-03 12:14 
GeneralWeird problem while inserting a record Pin
2sky1-Oct-03 23:53
2sky1-Oct-03 23:53 
GeneralRe: Weird problem while inserting a record Pin
Mike Dimmick2-Oct-03 3:26
Mike Dimmick2-Oct-03 3:26 
GeneralRe: Weird problem while inserting a record Pin
2sky2-Oct-03 3:35
2sky2-Oct-03 3:35 
Generalerror deleting record in datagrid Pin
Giovanni Bejarasco1-Oct-03 23:09
Giovanni Bejarasco1-Oct-03 23:09 
GeneralRe: error deleting record in datagrid Pin
Mike Dimmick2-Oct-03 12:18
Mike Dimmick2-Oct-03 12:18 
GeneralRe: error deleting record in datagrid Pin
Giovanni Bejarasco2-Oct-03 20:07
Giovanni Bejarasco2-Oct-03 20:07 
GeneralRe: error deleting record in datagrid Pin
Mike Dimmick2-Oct-03 22:30
Mike Dimmick2-Oct-03 22:30 
GeneralRe: error deleting record in datagrid Pin
Giovanni Bejarasco3-Oct-03 1:41
Giovanni Bejarasco3-Oct-03 1:41 
GeneralRe: error deleting record in datagrid Pin
Ian Darling3-Oct-03 22:16
Ian Darling3-Oct-03 22:16 
GeneralDatabases concurrecny issues Pin
Jahangir Jamshed1-Oct-03 19:26
sussJahangir Jamshed1-Oct-03 19:26 
GeneralRe: Databases concurrecny issues Pin
Andy Harman1-Oct-03 22:51
Andy Harman1-Oct-03 22:51 
GeneralRe: Databases concurrecny issues Pin
Mike Dimmick2-Oct-03 3:37
Mike Dimmick2-Oct-03 3:37 
GeneralRe: Databases concurrecny issues Pin
SimonS2-Oct-03 22:46
SimonS2-Oct-03 22:46 
GeneralDataRowState Problems Pin
Wjousts1-Oct-03 11:33
Wjousts1-Oct-03 11:33 
GeneralRe: DataRowState Problems Pin
Giovanni Bejarasco3-Oct-03 1:46
Giovanni Bejarasco3-Oct-03 1:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.