1)
Add button in you form.
2)
Right click an select Button Property.
3)
In action select Rules and Custom code.
4)
Click on edit form code.
5)
Paste the following code snippet there:
if
(this.Errors.Count == 0)
{
// no
validation error
//write
you code for form submission.
}
else
{
//validation
error.
}
These small lines of code will check you form for validation
errors, if there are no errors, the saving operation will continue, else the
saving operation will be canceled.