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. please help me with this code

please help me with this code

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

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' Dim GridView1 As New GridView Dim Login As Businesslayer.Users = New Businesslayer.Users 'Check for empty date fields and give usera message Dim str As String = " SELECT Rejected, Total_Hours, Category, Bill, Description, Hours, Date, Occupation, Project_Manager, Project_Member, Client_Site, Project_Name, Id_Number FROM Timesheet " & _ "WHERE (Date >= CONVERT(DATETIME, " & txtSDate.Text & " ))" & _ " AND (Date <= CONVERT(DATETIME," & txtEDate.Text & ")) ORDER BY Date " Dim bLayer As New Businesslayer.GlobalFunctions Dim reader As Data.SqlClient.SqlDataReader = bLayer.returnRecords(str) 'Test for record count > 0, give message to user for 0 records. If reader.HasRows Then Session("Client_site") = reader("ClientSite") Session("Project_Name") = reader("ProjectName") Session("Date1") = reader("SDate") Session("Date1") = reader("EDate") Response.Redirect("ViewTimesheet.aspx") Response.End() Else UserMsgBox("Please select the Start Date and End Date") End If End Sub ************* I want this button to display the gridview on the other page after the user select the starting date and Ending on to different calenders(according to the selected dates). oga m

    R 1 Reply Last reply
    0
    • O Oga M

      Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' Dim GridView1 As New GridView Dim Login As Businesslayer.Users = New Businesslayer.Users 'Check for empty date fields and give usera message Dim str As String = " SELECT Rejected, Total_Hours, Category, Bill, Description, Hours, Date, Occupation, Project_Manager, Project_Member, Client_Site, Project_Name, Id_Number FROM Timesheet " & _ "WHERE (Date >= CONVERT(DATETIME, " & txtSDate.Text & " ))" & _ " AND (Date <= CONVERT(DATETIME," & txtEDate.Text & ")) ORDER BY Date " Dim bLayer As New Businesslayer.GlobalFunctions Dim reader As Data.SqlClient.SqlDataReader = bLayer.returnRecords(str) 'Test for record count > 0, give message to user for 0 records. If reader.HasRows Then Session("Client_site") = reader("ClientSite") Session("Project_Name") = reader("ProjectName") Session("Date1") = reader("SDate") Session("Date1") = reader("EDate") Response.Redirect("ViewTimesheet.aspx") Response.End() Else UserMsgBox("Please select the Start Date and End Date") End If End Sub ************* I want this button to display the gridview on the other page after the user select the starting date and Ending on to different calenders(according to the selected dates). oga m

      R Offline
      R Offline
      RSArockiam
      wrote on last edited by
      #2

      The same manner you are assigning the value to session object, you can read the value from the session object and you can populate the grid. But in your question you are asking, "I want this button to display the gridview on the other page". What do you mean here?

      Regards R.Arockiapathinathan

      O 1 Reply Last reply
      0
      • R RSArockiam

        The same manner you are assigning the value to session object, you can read the value from the session object and you can populate the grid. But in your question you are asking, "I want this button to display the gridview on the other page". What do you mean here?

        Regards R.Arockiapathinathan

        O Offline
        O Offline
        Oga M
        wrote on last edited by
        #3

        I have disabled my session statement,but it still giving me the same problem. And when I say select all it diplay all the information inside the table in the gridview on the nextpage oga m

        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