Groups | Blog | Home
all groups > asp.net > march 2007 >

asp.net : EntLib 2.0 DAAB - Where did my RowsAffected property go?


Mike
3/31/2007 7:42:03 PM
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.

Mike
3/31/2007 8:00:02 PM
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.

[quoted text, click to view]
sloan
3/31/2007 10:47:28 PM
Its just the return value of ExecuteNonQuery

aka

int ExecuteNonQuery

int myvalue = db.ExecuteNonQuery( dbc , ....................... ) ;



[quoted text, click to view]

Mike
4/1/2007 6:56:00 PM
NOCOUNT OFF is what I needed! Thank you very much, Sloan, for helping with
this!

Mike

[quoted text, click to view]
sloan
4/1/2007 8:01:27 PM

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.



[quoted text, click to view]

AddThis Social Bookmark Button