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. parameters problem in .net 2005

parameters problem in .net 2005

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netdatabasevisual-studio
2 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.
  • J Offline
    J Offline
    jabbarsb
    wrote on last edited by
    #1

    hi friends, i am facing a problem in vs 2005 i am using gridview control and sqldatasource bounded to it in the update command of the sqldatasource i am passing a query UPDATE aspnet_UsersInRoles SET RoleId = @RoleId WHERE UserId =@userid the gridview is having three columns userid,username and roleid among which userid is hidden if i make this column visible then the above query is working fine but when i make it visible=false then i am getting an error : Must declare a variable @userid also i want to know if i place a dropdownlist in gridview how to access its selectedvalues as a parameter can anybody help me regards jabbar

    jabbarsb

    A 1 Reply Last reply
    0
    • J jabbarsb

      hi friends, i am facing a problem in vs 2005 i am using gridview control and sqldatasource bounded to it in the update command of the sqldatasource i am passing a query UPDATE aspnet_UsersInRoles SET RoleId = @RoleId WHERE UserId =@userid the gridview is having three columns userid,username and roleid among which userid is hidden if i make this column visible then the above query is working fine but when i make it visible=false then i am getting an error : Must declare a variable @userid also i want to know if i place a dropdownlist in gridview how to access its selectedvalues as a parameter can anybody help me regards jabbar

      jabbarsb

      A Offline
      A Offline
      Anil Ch
      wrote on last edited by
      #2

      Hi, error : Must declare a variable @userid when column propert visible is false is correct. Since in visual 2005 if column in visible false then data is not binded to that column. Sol: To avoid this problem make visible false of column in RowCreated event of grid. This will solve your problem. hope this helps. Cheers! Anil

      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