An example of advanced database search
Posted
by Phil
on Stack Overflow
See other posts from Stack Overflow
or by Phil
Published on 2010-03-24T12:05:09Z
Indexed on
2010/03/24
12:13 UTC
Read the original article
Hit count: 185
Hi there,
im looking for an example script. I saw one yesterday but for the life of me I can't find it again today.
The task I have is to allow the user to search 1 database table via input controls on an aspx page where they can select and , or , equals to combine fields, generating the sql on the fly with a stringbuilder or similar. (it runs behind the corp firewall)
Please can someone point me in the right direction of an example or tutorial
I've been working on the page, but have run into problems. Here is a snippet;
If NameSearch.Text IsNot String.Empty And andor1v IsNot "0" Then
sql += "Surname LIKE '%" & name & "%' " & andor1v & " "
ElseIf NameSearch.Text IsNot String.Empty And andor1v Is "0" Then
sql += "Surname LIKE '%" & name & "%' "
End If
© Stack Overflow or respective owner