Hello,
I've been trying and investigating the <Deletecommand> in the Templates for the last 2 days.
It looks like there is a bug that it can only accept 1 parameter. I've only tried with XMod Pro 4.2 (and didn't saw any fixes in the release notes for >4.2).
Example:
<DeleteCommand CommandText="DELETE FROM tbl_order_details WHERE order_detail_id=@order_detail_id AND order_detail_order_id=@order_id">
<Parameter Name="order_detail_id" DataType="int32" />
<Parameter Name="order_id" DataType="int32" DefaultValue='[[Url:DSParam1]]'/>
</DeleteCommand>
Getting the error:
Must declare the scalar variable "@order_id".
When checking the SQL Server Profiler I see this is parsed to SQL:
exec sp_executesql N'DELETE FROM tbl_order_details WHERE order_detail_id=@order_detail_id AND order_detail_order_id=@order_id',N'@order_detail_id nvarchar(5)',@order_detail_id=N'27833'
I've also tried with Stored Procedures using the "EXEC sp_..." command.
See an older forum topic:
http://old.dnndev.com/Support/Forums/tabid/215/aff/33/aft/29247/afv/topic/Default.aspx