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. How to pass the gridview datakey to filter a dataset, help pleas

How to pass the gridview datakey to filter a dataset, help pleas

Scheduled Pinned Locked Moved ASP.NET
csswpfwcfxmlhelp
1 Posts 1 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.
  • O Offline
    O Offline
    orsini
    wrote on last edited by
    #1

    HI, i am have this grid view, and i have a ds binding a repeater. i want to filter the select command depending on the seleccion in the gridview, i have this code, but i can't make work right. Sub BindData() 'Read sample item info from XML document into a DataSet Dim cnn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("vpx_newConnectionString").ToString) cnn.Open() Dim cmd As SqlDataAdapter = New SqlDataAdapter("select * from mediaphotos Where EventID =" & GridView1.SelectedValue, cnn) Dim ds As New DataSet() cmd.Fill(ds) ' Populate the repeater control with the Items DataSet Dim dsPaged As New PagedDataSource() dsPaged.DataSource = ds.Tables(0).DefaultView dsPaged.AllowPaging = True dsPaged.PageSize = 5 dsPaged.CurrentPageIndex = CurrentPage 'Disable Prev or Next buttons if necessary cmdPrev.Enabled = Not dsPaged.IsFirstPage cmdNext.Enabled = Not dsPaged.IsLastPage rptParts.DataSource = dsPaged rptParts.DataBind() can someone help me here, what i am doing wrong

    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