This is a migrated thread and some comments may be shown as answers.

Must declare the variable '@OrderID'

3 Answers 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Johan Olofsson
Top achievements
Rank 1
Johan Olofsson asked on 17 Jun 2008, 12:17 PM
I looked at the online demos of this control, section: "Insert/Update/Delete" / "Edit on Double-Click".

I created a project just like that and replaced the Session Data Source with an asp:SqlDataSource.
The latter does not take the argument PrimaryKeyFields which is set to "OrderID,ProductID" in the original data source.
Because of this (I assume), I get the error...

Unable to update Orders. Reason: Must declare the variable '@OrderID'.

..when trying to update. I am using the Northwind SQL database I have made no changes in the select or update command. How do I use this control with an asp:SqlDataSource?
  

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 18 Jun 2008, 05:45 AM
Hi Johan,

I have modified the demo in order to fit your needs. Please look at the attached file.

Best wishes,
Daniel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Johan Olofsson
Top achievements
Rank 1
answered on 18 Jun 2008, 08:09 AM
Actually that code did not help me at all. I still get the same error.
0
Daniel
Telerik team
answered on 18 Jun 2008, 04:31 PM
Hi Johan,

Please excuse me for sending you the wrong version of the project. I've attached the right version now.

Let me know whether you need additional assistance.

Kind Regards,
Daniel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Johan Olofsson
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Johan Olofsson
Top achievements
Rank 1
Share this question
or