Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. GridView Edit (Update)

GridView Edit (Update)

Scheduled Pinned Locked Moved ASP.NET
helpcsharpcssasp-netdatabase
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    ksaw123
    wrote on last edited by
    #1

    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.

    U J K 3 Replies Last reply
    0
    • K ksaw123

      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.

      U Offline
      U Offline
      Urs Enzler
      wrote on last edited by
      #2

      What's the signature of the method your ObjectDataSource calls on an Update? Parameters?

      -^-^-^-^-^- no risk no funk ................... please vote ------>

      1 Reply Last reply
      0
      • K ksaw123

        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.

        J Offline
        J Offline
        Jaiprakash M Bankolli
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • K ksaw123

          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.

          K Offline
          K Offline
          ksaw123
          wrote on last edited by
          #4

          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

          U 1 Reply Last reply
          0
          • K ksaw123

            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

            U Offline
            U Offline
            Urs Enzler
            wrote on last edited by
            #5

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

            K 1 Reply Last reply
            0
            • U Urs Enzler

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

              K Offline
              K Offline
              ksaw123
              wrote on last edited by
              #6

              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.

              U 1 Reply Last reply
              0
              • K ksaw123

                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.

                U Offline
                U Offline
                Urs Enzler
                wrote on last edited by
                #7

                I'd thought you use your own ObjectDataSource because the exception message said so.

                -^-^-^-^-^- no risk no funk ................... please vote ------>

                K 1 Reply Last reply
                0
                • U Urs Enzler

                  I'd thought you use your own ObjectDataSource because the exception message said so.

                  -^-^-^-^-^- no risk no funk ................... please vote ------>

                  K Offline
                  K Offline
                  ksaw123
                  wrote on last edited by
                  #8

                  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.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups