[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 727
  • Last Modified:

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?
0
Fraser_Admin
Asked:
Fraser_Admin
  • 2
  • 2
1 Solution
 
SameerJagdaleCommented:
0
 
apexpertCommented:
SET @Identity = SCOPE_IDENTITY()
return  @Identity
0
 
Fraser_AdminAuthor Commented:
apexpert, as I mentioned in my original question I am ending the sp with return SCOPE_IDENTITY()
0
 
Fraser_AdminAuthor Commented:
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.
0
 
SameerJagdaleCommented:
you can write an out paramter in DAL (ADO.NEt will return out parameter after executing SP), and then route it to your BLL.
Does it make sense?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now