I understand the error message, but I am not sure which exception to use as I want to generate my own error message.
As you can see I am using an exception but it seems not to be the correct one as I get the message attached not the one I want.Code:Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click Try Me.Validate() If RoomSetup.Focus Then Me.RoomCodesBindingSource.EndEdit() Me.RoomCodesTableAdapter.Update(Me.RestelDataSet.RoomCodes) End If If Accounts.Focus Then Me.BudgetTypesBindingSource.EndEdit() Me.BudgetTypesTableAdapter.Update(Me.RestelDataSet.BudgetTypes) End If Catch ex As System.Data.ConstraintException MsgBox("My Own Message of some sort") End Try End Sub
Any help would be appreciated.
Computerman![]()





Reply With Quote