Validating user input in vb net

6854933580_2c8b688306_z

This is my first time programming in VB and I am not entirely familiar with the validation process and how the validation should be done against the database (I am using SQL Server).

This is what I have until now: Private Sub Enter Click_Click(sender As Object, e As Event Args) Handles Enter Click.

Here is an example of input form that uses comparison validation to ensure that two password fields are the same: Next step is to attach event handler for Validate Value event on custom validator. NET property grid using the combo-box on top of the property grid: With Custom Validator component selected, switch to the event view: And double-click the Validate Value event to create event handler: Here is example code for Validate Value event handler: C# This example validation simply checks whether value entered is “Dot Net Bar” and validates control input if it is. Validating Event On Container At the bottom of this article you can find sample project that shows how to create simple Custom Validator from code.Select control you want to assign validation to and change its Validator1 property to choose desired validation type.In previous example you’ve seen required field validator.Super Validator can work with any of these components set or without any of them at all if you are planning to report validation results some other way.Next step is to choose the way Super Validator performs validation.The easiest way to find out how to do something from code is to setup the control the way you want it using designer and then explore Initialize Component() method. Error Provider = my Error Provider1 super Validator1. You assign your custom error provider to Custom Error Provider property.

You must have an account to comment. Please register or login here!