I found that on msdn, maybe help ?
protected void LinqDataSource_Inserting(object sender, LinqDataSourceInsertEventArgs e)
{
Product product = (Product)e.NewObject;
product.DateModified = DateTime.Now;
}
protected void LinqDataSource_Inserting(object sender,
LinqDataSourceInsertEventArgs e)
{
if (e.Exception != null)
{
foreach (KeyValuePair<string, Exception> innerException in
e.Exception.InnerExceptions)
{
Label1.Text += innerException.Key + ": " +
innerException.Value.Message + "<br />";
}
e.ExceptionHandled = true;
}
}