Delete command when using ASP.NET SqlDataSource control

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
jordan
Posts: 7
Joined: Tue 28 Mar 2006 08:05

Delete command when using ASP.NET SqlDataSource control

Post by jordan » Wed 29 Mar 2006 10:09

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.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 30 Mar 2006 09:21

orginal_id in should be original_id, shouldn't it? Maybe this is the problem.

jordan
Posts: 7
Joined: Tue 28 Mar 2006 08:05

Post by jordan » Thu 30 Mar 2006 10:04

Yes, that was the problem. I can't believe I didn't see that myself :oops:

Thanks,
Jordan.

Post Reply