yaanmonkey
Programmer
Hi,
i have an ASP.net page that has a gridview where the source is:
set rowcount @Top
SELECT
ID,
Title,
FirstName,
Surname,
FROM Leads_Source
WHERE
(ISNULL(Surname, '') LIKE @Surname + '%') AND
(ISNULL(County, '') LIKE @County + '%') AND
(ISNULL(Postcode, '') LIKE @Postcode + '%') AND
(ISNULL(HomePhone, '') LIKE @HomeTel + '%') AND
(isnull(AssignedTo,'')='') AND
(CallComplete_YN=0)
ORDER BY Surname
Which works fine as it allows the user to select the number of rows and the criteria to filter the data for the gridview.
What i am trying to do is allow the user to then select a staff member and update all the rows with his/her ID therefore assigning these rows to them.
i tried pretty much the same syntax but using:
SET AssignedTo= @AssignedTo
but it complains about the ORDER BY statement.
I need to order the records because the user will want to see them alphabetically and it was ordering them by ID. I obviously want the user to update only the records that they see on screen.
I am using SQL Server 2005 and ASP.NET 2.
Any help would be greatly appreciated. I am a bit of a newbie to this.
Many thanks,
Ian
i have an ASP.net page that has a gridview where the source is:
set rowcount @Top
SELECT
ID,
Title,
FirstName,
Surname,
FROM Leads_Source
WHERE
(ISNULL(Surname, '') LIKE @Surname + '%') AND
(ISNULL(County, '') LIKE @County + '%') AND
(ISNULL(Postcode, '') LIKE @Postcode + '%') AND
(ISNULL(HomePhone, '') LIKE @HomeTel + '%') AND
(isnull(AssignedTo,'')='') AND
(CallComplete_YN=0)
ORDER BY Surname
Which works fine as it allows the user to select the number of rows and the criteria to filter the data for the gridview.
What i am trying to do is allow the user to then select a staff member and update all the rows with his/her ID therefore assigning these rows to them.
i tried pretty much the same syntax but using:
SET AssignedTo= @AssignedTo
but it complains about the ORDER BY statement.
I need to order the records because the user will want to see them alphabetically and it was ordering them by ID. I obviously want the user to update only the records that they see on screen.
I am using SQL Server 2005 and ASP.NET 2.
Any help would be greatly appreciated. I am a bit of a newbie to this.
Many thanks,
Ian