After inserting a order record in a DetailsView I want to send a confirmation mail. Therefore I need the inserted ID within the Item_Inserted event of the DetailsView. I searched the e.Values and the DataKey items, but I didn't find it.
What shall I do to get the Last_Insert_ID() within my DetailsView?
Best Regards
Joachim van de Bruck
Sunshine Solutions
ASP.NET 2.0 GridView / DetailsView and SqlDataProvider
Use Inserted event of the SqlDataSource component:
Code: Select all
int InsertedId = ((CoreLab.MySql.MySqlCommand)e.Command).InsertId;