GridView Edit (Update)
-
Good day everybody... I am facing a problem with ASP.Net when trying to update information by clicking Edit on Grid View. I didn’t do anything with the code. I used only the build in functionality of Grid View, but it give me an error which is "ObjectDataSource 'ODSIPAddress' could not find a non-generic method 'UpdateQuery' that has parameters: OrgCode, Original_OrgCode, original_IPAddress." Moreover, I create new update statement to do the updating, but also do not work. This is happing only in updating. I don’t know If I am missing some thing or what??? In addition, I tried my query and test it and it is working fine inside, but not in Grid View. Thanks a lot.
-
Good day everybody... I am facing a problem with ASP.Net when trying to update information by clicking Edit on Grid View. I didn’t do anything with the code. I used only the build in functionality of Grid View, but it give me an error which is "ObjectDataSource 'ODSIPAddress' could not find a non-generic method 'UpdateQuery' that has parameters: OrgCode, Original_OrgCode, original_IPAddress." Moreover, I create new update statement to do the updating, but also do not work. This is happing only in updating. I don’t know If I am missing some thing or what??? In addition, I tried my query and test it and it is working fine inside, but not in Grid View. Thanks a lot.
What's the signature of the method your ObjectDataSource calls on an Update? Parameters?
-^-^-^-^-^- no risk no funk ................... please vote ------>
-
Good day everybody... I am facing a problem with ASP.Net when trying to update information by clicking Edit on Grid View. I didn’t do anything with the code. I used only the build in functionality of Grid View, but it give me an error which is "ObjectDataSource 'ODSIPAddress' could not find a non-generic method 'UpdateQuery' that has parameters: OrgCode, Original_OrgCode, original_IPAddress." Moreover, I create new update statement to do the updating, but also do not work. This is happing only in updating. I don’t know If I am missing some thing or what??? In addition, I tried my query and test it and it is working fine inside, but not in Grid View. Thanks a lot.
You will have to associate the update command with the method that handles the updated, in this case there are OrgCode, Original_OrgCode, original_IPAddress parameters which i assume a textbox. Just associate the method at run time or even you can have the datasource attached with updatecommand in the following manner UpdateCommand="UPDATE Organisation SET OrgCode= @OrgCode, Original_OrgCode= @Original_OrgCode, original_IPAddress=@original_IPAddress WHERE someId=@someId" I have just created an example sql statement you can replace it with the original statement
Regards, Jaiprakash M Bankolli jaiprakash.bankolli@gmail.com My Blog Suggestions for me
-
Good day everybody... I am facing a problem with ASP.Net when trying to update information by clicking Edit on Grid View. I didn’t do anything with the code. I used only the build in functionality of Grid View, but it give me an error which is "ObjectDataSource 'ODSIPAddress' could not find a non-generic method 'UpdateQuery' that has parameters: OrgCode, Original_OrgCode, original_IPAddress." Moreover, I create new update statement to do the updating, but also do not work. This is happing only in updating. I don’t know If I am missing some thing or what??? In addition, I tried my query and test it and it is working fine inside, but not in Grid View. Thanks a lot.
Thank you my brothers for your help, but I am new in this field if you could be more clear and here what I have. 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). Here is the error I am getting: 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
-
Thank you my brothers for your help, but I am new in this field if you could be more clear and here what I have. 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). Here is the error I am getting: 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
Let me ask you again: what's the signature of your Update method (UpdateQuery)? Post it here because your problem lies in the parameters to this method. One of OrgCode, IPAddress, original_IPAddressID, Original_OrgCode, Original_IPAddress is missing.
-^-^-^-^-^- no risk no funk ................... please vote ------>
-
Let me ask you again: what's the signature of your Update method (UpdateQuery)? Post it here because your problem lies in the parameters to this method. One of OrgCode, IPAddress, original_IPAddressID, Original_OrgCode, Original_IPAddress is missing.
-^-^-^-^-^- no risk no funk ................... please vote ------>
-
I am using the ASP.Net property (the build in update that comes with the GridView itself). I didn't write any query because when we use the GridView, the update comes with it because it is one of its property.
I'd thought you use your own ObjectDataSource because the exception message said so.
-^-^-^-^-^- no risk no funk ................... please vote ------>
-
I'd thought you use your own ObjectDataSource because the exception message said so.
-^-^-^-^-^- no risk no funk ................... please vote ------>
Then, I tried to use my own ObjectDataSource which refer to the table wanted. I created new update method (which you can choose it from the window that ask you which method you want to do such as DELETE, INSERT UPDATE and etc…) I chose UPDATE to be generated by the system. Thanks for your help.