Hi everybody,



I am having the following problem. While running my program I create a
DataRow (State - Detached). Then I add it to the DataTable (State - Added),
and delete it (State - Detached). Later I try to update the db by doing this

DataAdapter.Update(DataTable.Select("", "", DataViewRowState.Added))

DataAdapter.Update(DataTable.Select("", "", DataViewRowState.Modified))

DataAdapter.Update(DataTable.Select("", "", DataViewRowState.Deleted))

When I try to update the deleted records I get the following message:



"This row has been removed from a table and does not have any data.
BeginEdit() will allow creation of new data in this row.
System.Data.RowNotInTableException"



Does anyone know why this happens?

System.Data.RowNotInTableException - Why? by Ravikanth[MVP]

Ravikanth[MVP]
Mon Sep 01 23:16:25 CDT 2003

Hi


Represents the exception that is thrown when trying to
perform an operation on a DataRow that is not in a
DataTable.


Ravikanth[MVP]

>-----Original Message-----
>Hi everybody,
>
>
>
>I am having the following problem. While running my
program I create a
>DataRow (State - Detached). Then I add it to the
DataTable (State - Added),
>and delete it (State - Detached). Later I try to update
the db by doing this
>
>DataAdapter.Update(DataTable.Select("", "",
DataViewRowState.Added))
>
>DataAdapter.Update(DataTable.Select("", "",
DataViewRowState.Modified))
>
>DataAdapter.Update(DataTable.Select("", "",
DataViewRowState.Deleted))
>
>When I try to update the deleted records I get the
following message:
>
>
>
>"This row has been removed from a table and does not
have any data.
>BeginEdit() will allow creation of new data in this row.
>System.Data.RowNotInTableException"
>
>
>
>Does anyone know why this happens?
>
>
>.
>

Re: System.Data.RowNotInTableException - Why? by Laurent

Laurent
Tue Sep 02 06:06:25 CDT 2003

This means, that you created the row by another way then the "newrow() ?"
method of the datatable where you want to put the new row :-)


"Sasha" <no@no.com> wrote in message
news:uY%23zILQcDHA.2580@TK2MSFTNGP12.phx.gbl...
> Hi everybody,
>
>
>
> I am having the following problem. While running my program I create a
> DataRow (State - Detached). Then I add it to the DataTable (State -
Added),
> and delete it (State - Detached). Later I try to update the db by doing
this
>
> DataAdapter.Update(DataTable.Select("", "", DataViewRowState.Added))
>
> DataAdapter.Update(DataTable.Select("", "", DataViewRowState.Modified))
>
> DataAdapter.Update(DataTable.Select("", "", DataViewRowState.Deleted))
>
> When I try to update the deleted records I get the following message:
>
>
>
> "This row has been removed from a table and does not have any data.
> BeginEdit() will allow creation of new data in this row.
> System.Data.RowNotInTableException"
>
>
>
> Does anyone know why this happens?
>
>



Re: System.Data.RowNotInTableException - Why? by Sasha

Sasha
Tue Sep 02 12:40:38 CDT 2003

I understand this. But why is exception thrown?


"Ravikanth[MVP]" <dvravikanth@hotmail.com> wrote in message
news:00c901c37108$f975cd70$a001280a@phx.gbl...
> Hi
>
>
> Represents the exception that is thrown when trying to
> perform an operation on a DataRow that is not in a
> DataTable.
>
>
> Ravikanth[MVP]
>
> >-----Original Message-----
> >Hi everybody,
> >
> >
> >
> >I am having the following problem. While running my
> program I create a
> >DataRow (State - Detached). Then I add it to the
> DataTable (State - Added),
> >and delete it (State - Detached). Later I try to update
> the db by doing this
> >
> >DataAdapter.Update(DataTable.Select("", "",
> DataViewRowState.Added))
> >
> >DataAdapter.Update(DataTable.Select("", "",
> DataViewRowState.Modified))
> >
> >DataAdapter.Update(DataTable.Select("", "",
> DataViewRowState.Deleted))
> >
> >When I try to update the deleted records I get the
> following message:
> >
> >
> >
> >"This row has been removed from a table and does not
> have any data.
> >BeginEdit() will allow creation of new data in this row.
> >System.Data.RowNotInTableException"
> >
> >
> >
> >Does anyone know why this happens?
> >
> >
> >.
> >



Re: System.Data.RowNotInTableException - Why? by Sasha

Sasha
Tue Sep 02 12:41:28 CDT 2003

I am using strongly typed datasets, and I do use NewRow method of
DataTable...


"Laurent Lequenne" <laurent.lequenne@digipoint.be> wrote in message
news:OZzIDJUcDHA.3520@tk2msftngp13.phx.gbl...
> This means, that you created the row by another way then the "newrow() ?"
> method of the datatable where you want to put the new row :-)
>
>
> "Sasha" <no@no.com> wrote in message
> news:uY%23zILQcDHA.2580@TK2MSFTNGP12.phx.gbl...
> > Hi everybody,
> >
> >
> >
> > I am having the following problem. While running my program I create a
> > DataRow (State - Detached). Then I add it to the DataTable (State -
> Added),
> > and delete it (State - Detached). Later I try to update the db by doing
> this
> >
> > DataAdapter.Update(DataTable.Select("", "", DataViewRowState.Added))
> >
> > DataAdapter.Update(DataTable.Select("", "", DataViewRowState.Modified))
> >
> > DataAdapter.Update(DataTable.Select("", "", DataViewRowState.Deleted))
> >
> > When I try to update the deleted records I get the following message:
> >
> >
> >
> > "This row has been removed from a table and does not have any data.
> > BeginEdit() will allow creation of new data in this row.
> > System.Data.RowNotInTableException"
> >
> >
> >
> > Does anyone know why this happens?
> >
> >
>
>



Re: System.Data.RowNotInTableException - Why? by Sasha

Sasha
Tue Sep 02 20:11:11 CDT 2003

Resolved!

Thank you very much for your attention!


"Sasha" <no@no.com> wrote in message
news:uY%23zILQcDHA.2580@TK2MSFTNGP12.phx.gbl...
> Hi everybody,
>
>
>
> I am having the following problem. While running my program I create a
> DataRow (State - Detached). Then I add it to the DataTable (State -
Added),
> and delete it (State - Detached). Later I try to update the db by doing
this
>
> DataAdapter.Update(DataTable.Select("", "", DataViewRowState.Added))
>
> DataAdapter.Update(DataTable.Select("", "", DataViewRowState.Modified))
>
> DataAdapter.Update(DataTable.Select("", "", DataViewRowState.Deleted))
>
> When I try to update the deleted records I get the following message:
>
>
>
> "This row has been removed from a table and does not have any data.
> BeginEdit() will allow creation of new data in this row.
> System.Data.RowNotInTableException"
>
>
>
> Does anyone know why this happens?
>
>



RE: System.Data.RowNotInTableException - Why? by jiany

jiany
Tue Sep 02 20:44:41 CDT 2003

Hi Sasha,

I am very glad to know that the problem is resolved.

Is it possible for you to share your solution? Our goal is to provide
information to the entire community and the newsgroups allow everyone else
to benefit from our conversations. Thank you for your understanding. I
certainly appreciate your time.

Best regards,

Jacob Yang
Microsoft Online Partner Support
<MCSD>
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.