Page 1 of 1

Delete command when using ASP.NET SqlDataSource control

Posted: Wed 29 Mar 2006 10:09
by jordan
Hi,

I'm having a problem using the SqlDataSource control. When the SqlDataSource control needs to execute a DELETE command, I keep getting en error saying "'orginal_id' parameter is missing at the statement". Here is a bit of my code:

"
OldValuesParameterFormatString="original_{0}" ProviderName=""
SelectCommand="SELECT * FROM dapexportfields WHERE (typeid = ?) ORDER BY srt DESC" UpdateCommand="UPDATE dapexportfields SET name = ?, fielddescription = ?, valuedescription = ?, defaultvalue = ?, dbfieldname = ?,format = ?,srt = ? WHERE (id = ?)" DeleteCommand="DELETE FROM dapexportfields WHERE (id = ?)">


















The SELECT and UPDATE statements both work fine. The "OldValuesParameterFormatString" property of the control is set to "original_{0}"(which is the default value). The error is probably being caused by the SqlDataSource not being able to access the ORGINAL values from the dataset. Does anyone have a solution for this problem ?

Thanks in advance,
Jordan.

Posted: Thu 30 Mar 2006 09:21
by Alexey
orginal_id in should be original_id, shouldn't it? Maybe this is the problem.

Posted: Thu 30 Mar 2006 10:04
by jordan
Yes, that was the problem. I can't believe I didn't see that myself :oops:

Thanks,
Jordan.