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. Page load to display the gridview

Page load to display the gridview

Scheduled Pinned Locked Moved ASP.NET
help
3 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.
  • O Offline
    O Offline
    Oga M
    wrote on last edited by
    #1

    *This is my code *********** Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ds As New Data.DataSet Dim obj As Businesslayer.TimeSheet = New Businesslayer.TimeSheet Dim str As String = "select ProjectMember, Total_Hours from Timesheet" Dim repeater1 As Repeater Dim NumberOfBoxes As Integer Dim WhichBox As Integer NumberOfBoxes = Integer.Parse(WhichBox) Dim rows(NumberOfBoxes) As Integer For WhichBox = 0 To NumberOfBoxes rows(WhichBox) = WhichBox Next repeater1.DataSource = rows repeater1.DataBind() Dim bLayer As New Businesslayer.GlobalFunctions Dim reader As Data.SqlClient.SqlDataReader = bLayer.returnRecords(str) For WhichBox = 0 To NumberOfBoxes Dim cmbProjectName As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbProjectName"), DropDownList) Dim cmbClientSite As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbClientSite"), DropDownList) Dim cmbProjectManager As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbProjectManager"), DropDownList) Dim cmbCategory As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbCategory"), DropDownList) Dim cmbProjectMember As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbProjectMember"), DropDownList) Dim cmbOccupation As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbOccupation"), DropDownList) Next Session("Repeater1") = reader("Repeater") Session("ProjectMember") = reader("ProjectMember") Session("TotalHours") = reader("TotalHours") GridView1.DataSource = ds GridView1.DataBind() End Sub *********** *This is an error ********** Object reference not set to an instance of an object ***************** *I want the gridview to display selected values from the table **************** please help me what might be the problem oga m

    N T 2 Replies Last reply
    0
    • O Oga M

      *This is my code *********** Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ds As New Data.DataSet Dim obj As Businesslayer.TimeSheet = New Businesslayer.TimeSheet Dim str As String = "select ProjectMember, Total_Hours from Timesheet" Dim repeater1 As Repeater Dim NumberOfBoxes As Integer Dim WhichBox As Integer NumberOfBoxes = Integer.Parse(WhichBox) Dim rows(NumberOfBoxes) As Integer For WhichBox = 0 To NumberOfBoxes rows(WhichBox) = WhichBox Next repeater1.DataSource = rows repeater1.DataBind() Dim bLayer As New Businesslayer.GlobalFunctions Dim reader As Data.SqlClient.SqlDataReader = bLayer.returnRecords(str) For WhichBox = 0 To NumberOfBoxes Dim cmbProjectName As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbProjectName"), DropDownList) Dim cmbClientSite As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbClientSite"), DropDownList) Dim cmbProjectManager As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbProjectManager"), DropDownList) Dim cmbCategory As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbCategory"), DropDownList) Dim cmbProjectMember As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbProjectMember"), DropDownList) Dim cmbOccupation As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbOccupation"), DropDownList) Next Session("Repeater1") = reader("Repeater") Session("ProjectMember") = reader("ProjectMember") Session("TotalHours") = reader("TotalHours") GridView1.DataSource = ds GridView1.DataBind() End Sub *********** *This is an error ********** Object reference not set to an instance of an object ***************** *I want the gridview to display selected values from the table **************** please help me what might be the problem oga m

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Why don't wait for replies to the first post. :mad::mad: Yes, this one is different code but the problem is the same. :mad::mad:


      only two letters away from being an asset

      1 Reply Last reply
      0
      • O Oga M

        *This is my code *********** Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ds As New Data.DataSet Dim obj As Businesslayer.TimeSheet = New Businesslayer.TimeSheet Dim str As String = "select ProjectMember, Total_Hours from Timesheet" Dim repeater1 As Repeater Dim NumberOfBoxes As Integer Dim WhichBox As Integer NumberOfBoxes = Integer.Parse(WhichBox) Dim rows(NumberOfBoxes) As Integer For WhichBox = 0 To NumberOfBoxes rows(WhichBox) = WhichBox Next repeater1.DataSource = rows repeater1.DataBind() Dim bLayer As New Businesslayer.GlobalFunctions Dim reader As Data.SqlClient.SqlDataReader = bLayer.returnRecords(str) For WhichBox = 0 To NumberOfBoxes Dim cmbProjectName As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbProjectName"), DropDownList) Dim cmbClientSite As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbClientSite"), DropDownList) Dim cmbProjectManager As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbProjectManager"), DropDownList) Dim cmbCategory As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbCategory"), DropDownList) Dim cmbProjectMember As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbProjectMember"), DropDownList) Dim cmbOccupation As DropDownList = CType(repeater1.Items(WhichBox).FindControl("cmbOccupation"), DropDownList) Next Session("Repeater1") = reader("Repeater") Session("ProjectMember") = reader("ProjectMember") Session("TotalHours") = reader("TotalHours") GridView1.DataSource = ds GridView1.DataBind() End Sub *********** *This is an error ********** Object reference not set to an instance of an object ***************** *I want the gridview to display selected values from the table **************** please help me what might be the problem oga m

        T Offline
        T Offline
        ToddHileHoffer
        wrote on last edited by
        #3

        Go here to learn how to program with data in ASP.Net.

        GameFly free trial

        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