Juliano 的个人资料Juliano [Knowledge is ev...照片日志列表更多 工具 帮助

日志


1月31日

Executing a StoredProcedure in SqlDataSource

Today I came accross a problem at work, my SqlDataSource that uses a Stored Procedure to update some table data wasn't returning the number of affected rows, so my error handling wasn't working too, because it uses the number of affectes rows to check if the operations has been executed correctly.
 
I've made a search and found the solution. In my Stored Procedure I was using the SET NOCOUNT ON statement, but it prevents the return of the number of affected rows.
 
So the solution was simple, just take off the SET NOCOUNT ON statement, and everything worked without problems.
 
So, here is the tip. Simple, but useful if somebody have problemas like me.
 
See ya'.