Edit Grid View (urgent)
-
Hello everybody... In my Grid View I have 3 parameters: 1- IPAddressID (primary key) int not mull (cannot be updated (auto generated)). 2- OrgCode int not null (a dropdownlist that is taken from another table). 3- IPAddress varchar(50) not null (textbox). and I am getting this error when trying to update: ObjectDataSource 'ODSIPAddress' could not find a non-generic method 'UpdateQuery' that has parameters: OrgCode, IPAddress, original_IPAddressID, Original_OrgCode, Original_IPAddress. Here is the query that I am using for updating in the dataobject: UPDATE DHS_IPAddress SET OrgCode = @OrgCode, IPAddress = @IPAddress WHERE (IPAddressID = @Original_IPAddressID) AND (OrgCode = @Original_OrgCode) AND (IPAddress = @Original What should I do to solve this problem. I realy wish to get a clear answer.
-
Hello everybody... In my Grid View I have 3 parameters: 1- IPAddressID (primary key) int not mull (cannot be updated (auto generated)). 2- OrgCode int not null (a dropdownlist that is taken from another table). 3- IPAddress varchar(50) not null (textbox). and I am getting this error when trying to update: ObjectDataSource 'ODSIPAddress' could not find a non-generic method 'UpdateQuery' that has parameters: OrgCode, IPAddress, original_IPAddressID, Original_OrgCode, Original_IPAddress. Here is the query that I am using for updating in the dataobject: UPDATE DHS_IPAddress SET OrgCode = @OrgCode, IPAddress = @IPAddress WHERE (IPAddressID = @Original_IPAddressID) AND (OrgCode = @Original_OrgCode) AND (IPAddress = @Original What should I do to solve this problem. I realy wish to get a clear answer.
Since you are using an object datasource it is expecting that your update method will have parameters for all the editable fields in your gridview row. You need to create an update method and point to it in your objectdatasource. The signature of that method must match what the objectdatasource expects or it won't work. Inside that method take the three fields and call your update method. Hope that helps. Ben