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. Error : Does not have same signature as delegate

Error : Does not have same signature as delegate

Scheduled Pinned Locked Moved ASP.NET
htmlgraphicsdesignsysadminhelp
13 Posts 2 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.
  • S Sherin Iranimose

    Rock Star. wrote:

    Protected Sub Generic_DG_SelectedIndexChanged3(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

    How did you created that function,Is it an automatically generated, Or User defined? Where you are calling this function? Because No control handle attached to it. The second argument 'e' must be a type of System.EventArgs

    EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

    R Offline
    R Offline
    Rock Star
    wrote on last edited by
    #3

    Its a user defined function and I am calling it on the selected index changed event of datagrid.

    Rock Star

    S 1 Reply Last reply
    0
    • R Rock Star

      Its a user defined function and I am calling it on the selected index changed event of datagrid.

      Rock Star

      S Offline
      S Offline
      Sherin Iranimose
      wrote on last edited by
      #4

      In Your aspx page u can see, in the GV code, Following line OnSelectedIndexChanged="Generic_DG_SelectedIndexChanged3" Delete it. The function that you created is already attached to GV that is the problem. And call this function inside the GV's SelectedIndexChanged

      EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

      R 1 Reply Last reply
      0
      • S Sherin Iranimose

        In Your aspx page u can see, in the GV code, Following line OnSelectedIndexChanged="Generic_DG_SelectedIndexChanged3" Delete it. The function that you created is already attached to GV that is the problem. And call this function inside the GV's SelectedIndexChanged

        EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

        R Offline
        R Offline
        Rock Star
        wrote on last edited by
        #5

        Hi, I did it what you have mentioned but by deleting it for understanding the flow I have kept a msgbox in the function but it is not calling the Generic_DG_SelectedIndexChanged3 function becauuse it is not showing that msgbox too. One more thing I didnt understood your last comment i.e "And call this function inside the GV's SelectedIndexChanged "

        Rock Star

        S 2 Replies Last reply
        0
        • R Rock Star

          Hi, I did it what you have mentioned but by deleting it for understanding the flow I have kept a msgbox in the function but it is not calling the Generic_DG_SelectedIndexChanged3 function becauuse it is not showing that msgbox too. One more thing I didnt understood your last comment i.e "And call this function inside the GV's SelectedIndexChanged "

          Rock Star

          S Offline
          S Offline
          Sherin Iranimose
          wrote on last edited by
          #6

          When you pass a DataGridCommandEventArgs to a function you can assign that function only to OnEditCommand,OnUpdateCommand,OnItemCommand etc... I dont think there is a command event for SelectedIndexChanged.

          EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

          R 1 Reply Last reply
          0
          • R Rock Star

            Hi, I did it what you have mentioned but by deleting it for understanding the flow I have kept a msgbox in the function but it is not calling the Generic_DG_SelectedIndexChanged3 function becauuse it is not showing that msgbox too. One more thing I didnt understood your last comment i.e "And call this function inside the GV's SelectedIndexChanged "

            Rock Star

            S Offline
            S Offline
            Sherin Iranimose
            wrote on last edited by
            #7

            1.You can change your code that work with, SelectedIndexChanged of grid view. Dim index As Integer = Generic_DG.SelectedIndex cmd.Parameters.Add("@ProdId", SqlDbType.Int).Value = Generic_DG.DataKeys(index).Value.ToString()

            EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

            R 1 Reply Last reply
            0
            • S Sherin Iranimose

              When you pass a DataGridCommandEventArgs to a function you can assign that function only to OnEditCommand,OnUpdateCommand,OnItemCommand etc... I dont think there is a command event for SelectedIndexChanged.

              EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

              R Offline
              R Offline
              Rock Star
              wrote on last edited by
              #8

              Is there any other alternative for it? So I can bind my detailview on clickiking of select button in gridview.

              Rock Star

              1 Reply Last reply
              0
              • S Sherin Iranimose

                1.You can change your code that work with, SelectedIndexChanged of grid view. Dim index As Integer = Generic_DG.SelectedIndex cmd.Parameters.Add("@ProdId", SqlDbType.Int).Value = Generic_DG.DataKeys(index).Value.ToString()

                EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

                R Offline
                R Offline
                Rock Star
                wrote on last edited by
                #9

                Thanx it is running now but i m getting error as {"Must declare the scalar variable "@ProdId"."} for the code adapt.Fill(DT_DS, "Test") How can I declase avariable @prodID as a scalar variable?

                Rock Star

                S 1 Reply Last reply
                0
                • R Rock Star

                  Thanx it is running now but i m getting error as {"Must declare the scalar variable "@ProdId"."} for the code adapt.Fill(DT_DS, "Test") How can I declase avariable @prodID as a scalar variable?

                  Rock Star

                  S Offline
                  S Offline
                  Sherin Iranimose
                  wrote on last edited by
                  #10

                  Change the following line. cmd.CommandText = "select * from products where ProdID=@rodID" To cmd.CommandText = "select * from products where ProdID=" & Generic_DG.DataKeys(index).Value.ToString() and delete the following line. cmd.Parameters.Add("@ProdId", SqlDbType.Int).Value = Generic_DG.DataKeys(e.Item.ItemIndex)

                  EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

                  R 1 Reply Last reply
                  0
                  • S Sherin Iranimose

                    Change the following line. cmd.CommandText = "select * from products where ProdID=@rodID" To cmd.CommandText = "select * from products where ProdID=" & Generic_DG.DataKeys(index).Value.ToString() and delete the following line. cmd.Parameters.Add("@ProdId", SqlDbType.Int).Value = Generic_DG.DataKeys(e.Item.ItemIndex)

                    EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

                    R Offline
                    R Offline
                    Rock Star
                    wrote on last edited by
                    #11

                    Hi, Thanx a lot for helping me and giving your precious time to solve this bug. I am trying few more things on it.

                    Rock Star

                    S 1 Reply Last reply
                    0
                    • R Rock Star

                      Hi, Thanx a lot for helping me and giving your precious time to solve this bug. I am trying few more things on it.

                      Rock Star

                      S Offline
                      S Offline
                      Sherin Iranimose
                      wrote on last edited by
                      #12

                      Good Luck :)

                      EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

                      R 1 Reply Last reply
                      0
                      • S Sherin Iranimose

                        Good Luck :)

                        EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

                        R Offline
                        R Offline
                        Rock Star
                        wrote on last edited by
                        #13

                        Hi, I am trying some more operation on the details view. But I am getting some problem in it is specified in the following link http://www.codeproject.com/script/Forums/View.aspx?fid=12076 with the subject line as "Edit the data in a detail view at run time [modified]"

                        Rock Star

                        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