Validating data in asp

Click on the "Advanced" button and check the "Generate INSERT, UPDATE and DELETE statements" checkbox (Figure 3). Now that you have configured the SQL Data Source control let's bind it with a Grid View control. Open its smart tag and configure it as shown in Figure 4.Here, we set the Data Source of the Grid View to Sql Data Source1. We also enable paging, sorting and editing features of the Grid View.On the server, if any validation fails, print error messages prompting the user to make the necessary corrections onto the page and send the page back to the user.In the browser, call a Java Script method that validates the data being submitted before it's submitted..the data is not valid then cancel the page submit and display messages prompting the user to correct any invalid data...otherwise let it submit to the server. But in this case i need to validate a Employee ID number entered into a text box against a database table to check whether the ID number exists in the database, if the ID number doesn't exist in database i should not allow him to submit the form, need to print error message..I am using Active Server pages for form design, Java Script for server side validation and VBScript for Database connectivity.How can i validate a text box value against database table using ASP and VB Script..More information about input extensions and available methods can be found here.

When you receive the data on the server.....it to make sure that the data meets the validation conditions (your requirements) before trying to use it (especially before accessing a database).

Please advise Thanks again, Chandru Thanks for your response..

As SQL Count() function is used to get the number of emp ID's in the table, how will it check whether the employee ID entered by user(Front end) exists in the database??

There can be several approaches taken for validating data. For our example we are going to use Customers table of Northwind database. Open its smart tag and choose "Configure Data Source" option to start Configure Data Source wizard.

On the first step of the wizard click on "New Connection" button to open a dialog as shown in Figure 1.

Guest Editor: Today's post is from Taras Kholopkin. In this post, Taras will take a look at the data validation features built into the ASP. Data validation is one of the most important aspects of web app development.

Investing effort into data validation makes your applications more robust and significantly reduces potential loss of data integrity. NET MVC framework provides full support of special components and mechanisms on both the client side and the server side.

I have a form with various fields, one of which I need to check against data in a database table.

i.e if the value entered into the text input field exists in the database, the form should be submitted normally; otherwise an error message should be issued without submitting the form. Thanks You should always do server side validation.

Validating data entered by the user is one of the most common tasks in web applications. NET MVC is concerned there are various ways to accomplish this task.

As a web developer you should be aware of these options so that depending on your requirement you need to pick the appropriate one.

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