Delete command when using ASP.NET SqlDataSource control

Delete command when using ASP.NET SqlDataSource control

Postby 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:

ConnectionString="<%$ ConnectionStrings:vtuConnectionString %>"
OldValuesParameterFormatString="original_{0}" ProviderName="<%$ ConnectionStrings:vtuConnectionString.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 = ?)">











Name="typeid" PropertyName="SelectedValue" Size="38" Type="String" />






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.
jordan
 
Posts: 7
Joined: Tue 28 Mar 2006 08:05

Postby Alexey » Thu 30 Mar 2006 09:21

orginal_id in should be original_id, shouldn't it? Maybe this is the problem.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby 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.
jordan
 
Posts: 7
Joined: Tue 28 Mar 2006 08:05


Return to dotConnect for MySQL