|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
The ugly DeletedRowInaccessibleException errorI have a situation where I let users manipulate rows trough a datagridview,
when they save, I scroll trough the rows created by .GetChanges and report to the database any changes through stored procedures. For updates and inserts, there is no problems but for deletes I need a way to send to the stored procedure the key value or values to delete the right row. But of course, if I try to ask for the value of key column(s) I get the exception. Anybody knows how to go around this? "Johnny" <Joh***@discussions.microsoft.com> wrote in message I think you have to access the *original* version of the row, something news:28A0E087-E33A-4AB5-A9E0-CD2FE8844C57@microsoft.com... >I have a situation where I let users manipulate rows trough a datagridview, > when they save, I scroll trough the rows created by .GetChanges and report > to > the database any changes through stored procedures. For updates and > inserts, > there is no problems but for deletes I need a way to send to the stored > procedure the key value or values to delete the right row. But of course, > if > I try to ask for the value of key column(s) I get the exception. Anybody > knows how to go around this? like: row[column, DataRowVersion.Original] Chris Jobson I will try that but I also found an easy way out. Once I know the row is
deleted, I doa CancelChanges, then pick up data need. Thanks for the suggestion Show quote "Chris Jobson" wrote: > "Johnny" <Joh***@discussions.microsoft.com> wrote in message > news:28A0E087-E33A-4AB5-A9E0-CD2FE8844C57@microsoft.com... > >I have a situation where I let users manipulate rows trough a datagridview, > > when they save, I scroll trough the rows created by .GetChanges and report > > to > > the database any changes through stored procedures. For updates and > > inserts, > > there is no problems but for deletes I need a way to send to the stored > > procedure the key value or values to delete the right row. But of course, > > if > > I try to ask for the value of key column(s) I get the exception. Anybody > > knows how to go around this? > > I think you have to access the *original* version of the row, something > like: > row[column, DataRowVersion.Original] > > Chris Jobson > > > |
|||||||||||||||||||||||