The following code may handle the exception when insert the duplicate records
protected void SqlDataSource1_Inserted(object sender, SqlDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
//handle error or display message on label or something here
}
}
0 Comments:
Post a Comment