Jump to content

Search and display data in dataview

- - - - -

  • Please log in to reply
1 reply to this topic

#1
avosoft

avosoft

    Learning Programmer

  • Members
  • PipPipPip
  • 47 posts
Hello guys,

Am searching a database with three text fields so that i can display the records in a dataview.

At least one text filed must be filled, then the other two are optional., and one field of the record has PDF file names saved in it ,

how do i search and display in dataview on the same page,, and put a link in the dataview that links to the corresponding file on server?

Thanks in advance
Programming is all about good logic. Spend more time here

vHost for Apache:thumbup1:

#2
gokuajmes

gokuajmes

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 518 posts
just a hint for you to start working ,
start by creating 3 methods
dsSearch(strToSearch)
dsSearch(strToSearch,opt1)
dsSearch(strToSearch,opt1,opt2)
the methods return entries via DataSet that is the reason for the Ds as prefix.
Now do a conditional check to see which are the fields the user searches for then make the choice accordingly.

rough blueprint:
===========
dataset ds1= new DataSet();
optSelected = srchTermsTicked;
switch(optSelected)
{
case "opt1":
ds1 = dsSearch(opt1)
break;
case "opt2"://opt2 represents that both txtbox & optional term1 is searched for
ds1 = dsSearch(strToSearch,opt2)
break;
case "opt3"://opt3 represents that all search options are searched for.
 ds1 = dsSearch(strToSearch,opt2,opt3)
 break;
}

+Rep is the way to go if you think the post helped you

Edited by gokuajmes, 12 May 2010 - 12:51 AM.
included the code tags





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users