当我执行insert操作后对OnItemInserted事件设置了断点
protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
//e.AffectedRows
Response.Write("A:"+e.AffectedRows.ToString());
Response.Write("<br>");
Response.Write(e.Exception.Message);
}
发现无论插入操作是否成功,e.AffectedRows总是返回-1
而当运行到e.Exception.Message时,无论操作是否成功,总是抛出"Object reference not set to an instance of an object"的异常
.....调试中....