EntLib 2.0 DAAB - Where did my RowsAffected property go?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The DBCommandWrapper class doesn't exist in Enterprise Library because it's
properties/methods have been relocated to other classes. Where did the
RowsAffected properties go? I can't find this property anywhere?

I use this property when, for example, calling SQL 'Update' stored
procedures. I call the procedure, and then evaluate the number of affected
records to determine if the command completed successfully.

Thanks.
 
sloan, I consistantly get -1 as the int value using that method. I execute
UPDATE and DELETE stored procs, and despite that they successfully UPDATE or
DELETE one row, it returns -1. Shouldn't it return 1?

Thanks for your help.
 
Its just the return value of ExecuteNonQuery

aka

int ExecuteNonQuery

int myvalue = db.ExecuteNonQuery( dbc , ....................... ) ;
 
First, Selects are not in this number.

Second, make sure NOCOUNT OFF
is set.

Aka, when you set NOCOUNT ON, you're saying "don't report a rowcount", thus
ExecuteNonQuery does not work.
 
Back
Top