Bhavesh Vankar

Bhavesh Vankar

  • 725
  • 1.1k
  • 78.7k

how to search and display record from table ?

Mar 28 2022 1:18 PM

in my form having three textboxes for First Name, Middle Name, Last Name, and some textboxes for other details to store in db.

now if user enter firstname and last name in textbox and enter name is blocked in application so one popup page should be open and should be display record like, name, address, mono, and photo.

i tried to solve this but issue is the query should be validate probality for blocked person. like if first name's 4 character and last name's 4 character's probality should be validate...

second issue is the name is stored in single column in table. 

after popup open user should move record next or preveous to check propbality of blocked persons in application.

i tryied as below...

how to make query to find probality of blocked person for first 4 and last 4 character from table....

query += "SELECT * FROM (";
        query += "    SELECT ROW_NUMBER() OVER(ORDER BY ID) AS 'RowNo',";
        query += "        NAME,ADDRESS,CITYORVILLAGE,TALUKA,DISTRICT,CONTACTNO,(SELECT COUNT(*) FROM RESTICTIED_PERSONS) AS 'Total'";
        query += "    FROM RESTICTIED_PERSONS";
        query += ") t ";
        query += "WHERE t.RowNo = @Row";

 


Answers (3)