Developer forum

Forum » CMS - Standard features » Datalist update problems

Datalist update problems

Rene Poulsen
Reply

Hi,

I have a datalist where the user is shown a link for every 5 rows in the datalist. When the user clicks on the link after the first 5 rows, then these 5 rows have to be updated (just want to set one column to 'off').

When i use the following (quite simple) SQL it works through the SQL firehose - the 5 rows get's updated like it's supposed to. But when i create a datalist to update the rows and insert it on a page all rows gets updated.

The SQL is:

 

UPDATE TOP (5) SalgTest
SET SalgTest_AllowDelete = 'off'
WHERE SalgTest_UserID = '@Session("DW_extranet_AccessUserID")'
AND SalgTest_AllowDelete = 'on'

I've also tried the following, but that doesn't work either:

UPDATE SalgTest
SET SalgTest_AllowDelete = 'off'
WHERE SalgTestID IN (
SELET TOP 5 SalgTestID
FROM SalgTest
WHERE SalgTest_UserID = '@Session("DW_extranet_AccessUserID")'
AND SalgTest_AllowDelete = 'on'
)

Why does this not work through the datalist module? Or even better - can anyone of you find another way to accomplish this?

Thanks in advance

 


Replies

 
Morten Snedker
Reply

Hi Rene,

 

Sorry for the late reply! Are you still out on a limb with this one - or did you solve it many moons ago?

 

Regards /Snedker

 

 

 

 

 
Rene Poulsen
Reply

Hi Morten,

Not really - the customer changed something on how it had to work, so we didn't need to do this. But i would still like to know if it's possible to do what I wanted to do :-)

 

 

 

You must be logged in to post in the forum