Search in .NET

  • Thread starter Umberto Coppolino
  • Start date
U

Umberto Coppolino

Hi,
in ASP I make my search in 3 different types: partial search (with SQL
instruction "... LIKE '%text%'"), initial search (with SQL instruction "...
LIKE 'text%'") or integral search (with SQL instruction "... = 'text'").
Then I make my query string in this way:

<%
SearchType = Request.Form("Type") ' from ListBox
Select Case SearchType
Case 1 ' partial search
QueryStr = " WHERE Name LIKE '%" & Request.Form("Name") & "%'"
Case 2 ' initial search
QueryStr = " WHERE Name LIKE '" & Request.Form("Name") & "%'"
Case 3 ' integral search
QueryStr = " WHERE Name = '" & Request.Form("Name") & "'"
End Select
%>

and then I make the rsCustomer.Source ...

<%
set rsCustomer = Server.CreateObject("ADODB.Recordset")
rsCustomer.ActiveConnection = MM_Farm_String
rsCustomer.Source = "SELECT * FROM dbo.Customer " & QueryStr
rsCustomer.CursorType = 0
rsCustomer.CursorLocation = 2
rsCustomer.LockType = 3
rsCustomer.Open()
%>

I'll like to make it in ASP .NET. How can I do it?

Best regards.

Umberto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,093
Messages
2,570,607
Members
47,227
Latest member
bluerose1

Latest Threads

Top