Click here to Skip to main content
15,904,497 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
plz send me some help..

if we r searching Firstname from datagrid n we got that.. afterwards we have to find out surname for that first name.. the records fetched for firstname should remain as it is n now we have to find out surname for the same firstname we got in datagrid..
then how we should code for it??
Posted

1 solution

Perform another search on the database, appending the surname to the intial where clause string used.

e.g. [ Pseudocode fix up for your own needs ]

Dim query as string
if textSurname.text = string.empty then
    query = "Select Firstname From Names Where Firstname='" + textFirstname +"'"
else
    query = "Select * From Names Where Firstname='" + textFirstname + "' AND Surname='" + textSurname + "'"
end if
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900