After entering the sql statement da.deletecommand.commandtext = "Delete from
Users where username = @username" I set the parameter to the username I wish
to delete.

This successfully deletes the user. However, even if I enter an non-existant
user, I cannot discern whether a user was deleted or not. Is there a way to
do this? (I would rather not use a dataset, since I am trying to increase
performance).

thanks in advance

Rodger Dusatko

Re: DeleteCommand.executenonquery with ADO.NET - How do I know if a record was deleted? by Cor

Cor
Mon May 31 10:06:59 CDT 2004

Hi Rodger,

This I did send in the language.vb group,

When you want only to do deletecommands, have than a look at the normal
command execute methods (scroll a little bit in it, because there are more)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatasqlclientsqlcommandclassexecutenonquerytopic.asp

I did not know that you was that fast following the advice from Armin,
(This for the others, otherwise they do not understand my message above)

:-)

Cor



RE: DeleteCommand.executenonquery with ADO.NET - How do I know if a record was deleted? by davidsc

davidsc
Wed Jun 09 20:58:12 CDT 2004

Rodger,

The return value of Command.ExecuteNonQuery indicates the number of
rows affected by the query.

I hope this information proves helpful.

David Sceppa
Microsoft
This posting is provided "AS IS" with no warranties,
and confers no rights. You assume all risk for your use.
© 2004 Microsoft Corporation. All rights reserved.