Start Validating data in vb net

Validating data in vb net

You can validate data by handling the Cell Validating event, which is raised by the Data Grid View when the current cell changes.

It's a good practice to validate data prior to sending updates to the underlying database.

This reduces errors as well as the potential number of round trips between an application and the database.

Shannon Horn is the co-founder and chief software architect of Web Geniuses Corporation ( Hence, many times validation was not performed in a uniform manner, complex validation was difficult to implement, and Web servers were vulnerable to validation scripts being modified by malicious users.

He is a Microsoft Certified Application Developer (MCAD), Microsoft Certified Solution Developer (MCSD) and a Microsoft Certified Trainer (MCT) who has been developing Microsoft Windows and Web-based solutions as well as training for over 12 years. Shannon lives in Glendale, AZ, and is married with two daughters and a son. Validating the information entered by users is an essential part of developing a professional Web-based user interface.

On save, the entered values persist only if they can be parsed as floats.

The following code shows the Save Button_Click event handler in the Fillup Page class.

If values have been entered into each Text Box, an attempt is made to parse the values into values of type float.

If parsing fails, a Message Box is displayed indicating the failure to the user.

Using that logic is like saying don't bother writing Java Script validation for the web because the user might have Java Script turned off...

No write the first line of defense, but recognize the job does not end there... If I’m typing some text and the application prevents that (regardless of how it does that), I’m rightfully pissed off.

Validation requirements often vary, but typically you want to validate data to prevent incorrect values from being saved.