Home All Groups Group Topic Archive Search About

newrow ID with detailsview and objectdatasource

Author
24 Feb 2006 5:58 PM
Trapulo
I've a problem inserting a new row using a detailsview and an
objectdatasource.

I've defined the objectDatasource and it is using well a custom object to
insert the new item on db. All works fine, but now I need to get the ID of
the inserted row (the ID is an autoincrement value assigned by db, or can be
defined by my BLL) when the operation is completed. I can read this value in
my "SelectMethod" routine, but I dont' know hot to export this value to
calling objectdatasource, and then to calling web form. How can I make this?

thanks

Author
24 Feb 2006 6:09 PM
Phillip Williams
In this demo, the BLL function that does the record insert returns the record
ID of the inserted record, which I can retrieve in the webform during
handling the Inserted event of the ObjectDataSource:
http://www.webswapp.com/codesamples/aspnet20/dependentlists/default.aspx

Show quoteHide quote
"Trapulo" wrote:

> I've a problem inserting a new row using a detailsview and an
> objectdatasource.
>
> I've defined the objectDatasource and it is using well a custom object to
> insert the new item on db. All works fine, but now I need to get the ID of
> the inserted row (the ID is an autoincrement value assigned by db, or can be
> defined by my BLL) when the operation is completed. I can read this value in
> my "SelectMethod" routine, but I dont' know hot to export this value to
> calling objectdatasource, and then to calling web form. How can I make this?
>
> thanks
>
>
>
>
>
>
>
Author
25 Feb 2006 2:10 PM
Trapulo
Thankyou

I was looking for something in detailview.inserted, not in
objectdatasource.inserted.

Show quoteHide quote
"Phillip Williams" <WEBSWAPP@newsgroups.nospam> wrote in message
news:11D3B787-F1AD-472F-8E44-629955F32509@microsoft.com...
> In this demo, the BLL function that does the record insert returns the
> record
> ID of the inserted record, which I can retrieve in the webform during
> handling the Inserted event of the ObjectDataSource:
> http://www.webswapp.com/codesamples/aspnet20/dependentlists/default.aspx
>
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Trapulo" wrote:
>
>> I've a problem inserting a new row using a detailsview and an
>> objectdatasource.
>>
>> I've defined the objectDatasource and it is using well a custom object to
>> insert the new item on db. All works fine, but now I need to get the ID
>> of
>> the inserted row (the ID is an autoincrement value assigned by db, or can
>> be
>> defined by my BLL) when the operation is completed. I can read this value
>> in
>> my "SelectMethod" routine, but I dont' know hot to export this value to
>> calling objectdatasource, and then to calling web form. How can I make
>> this?
>>
>> thanks
>>
>>
>>
>>
>>
>>
>>