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