Hi All,
i am using sql datasource to display data in gridview and type as =Stored proc which has 5 parameters. the problem is that during configuration when i click on test query in data source it display the data. but fail to display in gridview. wats the problem???
datagrid is able to display data only in one condition when i pass all the parameters. if i pass any null value sql data source disply the data but grid view doesn't.
SP:
ALTER PROCEDURE [dbo].[USP_ExtendedSearch]
(
@userName NVARCHAR(30),
@searchUsers NVARCHAR(30),
@Name NVARCHAR(30),
@City NVARCHAR(30),
@email NVARCHAR(30)
)
AS
BEGIN
SELECT a.userID,a.username AS UName,
a.firstname+' '+a.lastname AS Name,
a.useremail AS EmailID,
a.city AS City,
b.imagePath
FROM userRegistrationTB a
JOIN imageTB b
ON
a.userID=b.UserID
WHERE
a.username!=@userName
AND
a.username LIKE '%'+ISNULL(@searchUsers,'')+'%'
AND a.firstname LIKE '%'+ISNULL(@Name,'')+'%'
AND a.city LIKE '%'+ISNULL(@City,'')+'%'
AND a.useremail LIKE '%'+ISNULL(@email,'')+'%'
SET NOCOUNT ON;