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
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