Home All Groups Group Topic Archive Search About

The ugly DeletedRowInaccessibleException error

Author
1 Jul 2006 4:13 PM
Johnny
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?

Author
2 Jul 2006 5:56 PM
Chris Jobson
"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
Author
2 Jul 2006 9:21 PM
Johnny
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
>
>
>

AddThis Social Bookmark Button