Practical 2

  1. Create a web form that contains two label that display Enter first number and enter second number, two text box for taking an input, third text box for output and three button add, subtract and find prime. Add proper validation like text box should not be empty, value of first field should be greater than value of second field. If add button is clicked display the addition of two number given in textboxes, if subtract button is clicked display the subtraction of two number given in textboxes and if findprime is clicked then display the prime number from first value to second value given in textboxes. Solution

  2. Write a console program (ADO.net) to create a table tbl_registration that have fields (id int primary key, username, password, repassword, gender, course and country). After this perform the following operation. Solution

    • Insert any 5 data into tbl_registration. All the required input should be taken from user

    • Display all the record of database table

    • Update the name and course of a person to data given by user according to id given by user

    • Delete the record of person whose id is given by user

    • Display all the record of person who are male and also from country Nepal

  3. For the table created in question no. 3, create a web form for registration which should contains username, password, repassword, gender (radio button), course (checkbox) and country (dropdown) and submit button. When submit is pressed insert the value given by user into database table. Use proper validation: username, password and repassword should not be empty, item of radio button, checkbox and dropdown menu should be selected. Solution

Last updated