R
rk325
Hi all,
I'm using VB.NET for this one, and it is straight forward.
I have a sp that takes an input parameter (a string) for querying the
db. Here is the sp:
CREATE PROCEDURE [dbo].[web_SearchByName]
@LastName varchar(80)
AS
SELECT Parcel.[Parcel ID],[Parcel Number],
RTRIM([address Number]) + ' ' + RTRIM([Address Street Name])
As [Address], [Last Name]
FROM Parcel INNER JOIN [Ownership] on
[Ownership].[Parcel Id]= [Parcel].[Parcel Id]
INNER JOIN [Entity] ON
[Entity].[Entity ID]=[Ownership].[Entity ID]
WHERE [TO DATE] IS NULL and [Primary owner]=1 and
[Last Name] LIKE @LastName
ORDER BY [Last Name]
--REPLACE(@LastName, CHAR(39), CHAR(39) + CHAR(39))
GO
Note, I even used the REPLACE statement after LIKE instead of the plain
@LastName, but still does not work.
In my code, I format the input string to have doubel quotes if there is
a single quote:
myString = Replace(mysring, "'", "''")
and I do verify that the input parameter contains double quotes when
running from source code ......but I still do not get results.
Any ideas why?
I also tried replacing each sinque quote by 4 consecutive single
quotes, and nothing.
Please your quick will be appreciated.
I'm using VB.NET for this one, and it is straight forward.
I have a sp that takes an input parameter (a string) for querying the
db. Here is the sp:
CREATE PROCEDURE [dbo].[web_SearchByName]
@LastName varchar(80)
AS
SELECT Parcel.[Parcel ID],[Parcel Number],
RTRIM([address Number]) + ' ' + RTRIM([Address Street Name])
As [Address], [Last Name]
FROM Parcel INNER JOIN [Ownership] on
[Ownership].[Parcel Id]= [Parcel].[Parcel Id]
INNER JOIN [Entity] ON
[Entity].[Entity ID]=[Ownership].[Entity ID]
WHERE [TO DATE] IS NULL and [Primary owner]=1 and
[Last Name] LIKE @LastName
ORDER BY [Last Name]
--REPLACE(@LastName, CHAR(39), CHAR(39) + CHAR(39))
GO
Note, I even used the REPLACE statement after LIKE instead of the plain
@LastName, but still does not work.
In my code, I format the input string to have doubel quotes if there is
a single quote:
myString = Replace(mysring, "'", "''")
and I do verify that the input parameter contains double quotes when
running from source code ......but I still do not get results.
Any ideas why?
I also tried replacing each sinque quote by 4 consecutive single
quotes, and nothing.
Please your quick will be appreciated.