T
Tom Garratt via .NET 247
I am using a try/catch block to catch a constraint exception whena new row is added or changed, like this:
Try
...
m_Contact.Tables(1).Rows.Add(dr)
...
Catch ex As Data.ConstraintException
MsgBox("This combination of user and location already exists!You can only select a unique combination.",MsgBoxStyle.Information)
End Try
However, on the first attempt at adding a user/location that arealready in the datatable, the constraint error takes a second orso to execute and move to the msgbox code. It is fine fromthereon after. Is there a way of speeding up this exceptionthrowing time? I suppose it would be the same for allexceptions.
Thanks, Tom
Try
...
m_Contact.Tables(1).Rows.Add(dr)
...
Catch ex As Data.ConstraintException
MsgBox("This combination of user and location already exists!You can only select a unique combination.",MsgBoxStyle.Information)
End Try
However, on the first attempt at adding a user/location that arealready in the datatable, the constraint error takes a second orso to execute and move to the msgbox code. It is fine fromthereon after. Is there a way of speeding up this exceptionthrowing time? I suppose it would be the same for allexceptions.
Thanks, Tom