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

  • Thread starter Thread starter Rodger Dusatko
  • Start date Start date
R

Rodger Dusatko

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
 
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.
 
Back
Top