instead of supply where clause, i prefer choose row from table and delete it
with
"row.Delete(); dataAdapther.Update(table);" . idont understand why i am not
allowed; what is the harm about it? why primary key is needed for delete but
not for insert or update operations?
thanks
> If your table doesn't have a primary key, then you'll need to supply a WHERE
> clause that is distinct enough to disambiguate which rows to delete.
[quoted text clipped - 7 lines]
> > from
> > Datatable which doesnt contain primary key
Lasse Vågsæther Karlsen - 15 May 2008 09:02 GMT
> instead of supply where clause, i prefer choose row from table and delete it
> with
[quoted text clipped - 14 lines]
>>> from
>>> Datatable which doesnt contain primary key
What if you have multiple rows with the same data? I know you can simply
say "I know I don't", but .NET can't *know* that, and it requires
something to uniquely identify the rows to delete.
On a different note, every table should have a primary key or you'll
most likely have problems with it later on, like duplicate data.

Signature
Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3