ObjectDataSource problem with return newly inserted record id

F

fig000

Hi,

I'm using an objectdatasource. The insert procedure called by the
objectdatasource is in a separate library file outside of the aspx and
the codebehind that is using the objectdatasource in question (I guess
that separate file would be called a bll).

I had originally used the parameter list method to pass the
inserted values to thie insert procedure which also gave me the
ability to add a retun parameter to access the newly created record id
(identity). I've changed to use the much easier method of using the
dataobjecttypename and the typename to pass the inserted values into
the procedure through an instantiation of my business object. As a
result the only parameter in the signature of the insert proc is of
the type of the business object.

This works very well. However I am no longer able to pass the newly
inserted record id back to the aspx page that called it. I could
access it in the insert proc and put it in a session variable but
this, to me, is bad practice. I tried adding another parameter to the
insert parameters list for the objectdatasource called newid and then
added that to the parameter list in the insert proc. I got an error
that led me to believe that the objectdatasource was still looking for
an insert proc that had only the business class type in its parameter
list. In other words, the second parameter does not seem to be welcome
using the typename and dataobjecttype name parameters; it's expecting
only the business object.

I'm not sure if I need a different method of passing back the new
record id or if I just did it wrong and it is possible to add a second
parameter under these circumstances. Any advice would be appreciated.

Thanks,
Fig000
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top