Link to home
Start Free TrialLog in
Avatar of Fraser_Admin
Fraser_AdminFlag for Canada

asked on

BLL DAL ObjectDataSource InsertMethod

I am using a stored procedure to insert into my table from my DAL.

The stored procedure ends with return @@scope_identity

I now want to access that in my BLL so I can return it back to the objectdatasource inserted event and then use it on my page.

retval = Adapter.Update(mytable)

always returns the records affected (which is 1).  how do i get this value?
Avatar of SameerJagdale
SameerJagdale
Flag of United States of America image

Avatar of apexpert
apexpert

SET @Identity = SCOPE_IDENTITY()
return  @Identity
Avatar of Fraser_Admin

ASKER

apexpert, as I mentioned in my original question I am ending the sp with return SCOPE_IDENTITY()
the example you gave is an ADO.NET example.  I'm looking for an example for BLL/DAL.

Return scope_identitty from the sp then receive this value in my BLL to return to my objectdatasource inserted event.
ASKER CERTIFIED SOLUTION
Avatar of SameerJagdale
SameerJagdale
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial