Re: LinqDataSource. Get ID

Re: LinqDataSource. Get ID

am 23.12.2007 04:35:35 von nothingsoriginalontheinternet

On Dec 17, 9:05 pm, shapper wrote:
> Hello,
>
> How can I get the ID (primary key) of a record just inserted in a
> database table by a LinqDataSource?
>
> Thanks,
> Miguel

Handle the LinqDataSource's Inserted event and get the Result property
from the event args:

protected void MyLinqDataSource_Inserted(object sender,
LinqDataSourceStatusEventArgs e)
{
Whatever thing = (Whatever)e.Result;
//id is in: thing.
}

-Michael Placentra II