request querystring
hi all,
im trying to use a request.querystring to link my page. whereby when the user click on the calendar, it will link to the exact date and event for the day. but it does not seem to be working. hope anyone can help me in this. thanks!
Private Sub eventDate_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles eventDate.SelectionChanged
Dim sql, dbcomm
Dim dbcon As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Inetpub\wwwroot\fyr project\bin\DESIGNATION.mdb;")
sql = "SELECT * FROM EVENT"
dbcomm = New OleDbCommand(sql, dbcon)
Dim dr As OleDbDataReader
dbcon.Open()
dr = dbcomm.executeReader()
Do While dr.Read
Response.Redirect("displayCalendarEvent.aspx?query =" & eventDate.SelectedDate & "")
Loop
End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataGrid1.CurrentPageIndex = 0
Session("date") = Request.QueryString("query")
Label1.Text = Session("date")
Dim sql, dbcomm, dbread
Dim dbcon As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Inetpub\wwwroot\fyr project\bin\DESIGNATION.mdb;")
dbcon.Open()
sql = "SELECT * FROM EVENT WHERE event_date = '" & Session("date") & "'"
dbcomm = New OleDbCommand(sql, dbcon)
Dim ds As New DataSet
Dim adapter As New OleDbDataAdapter
adapter.SelectCommand = dbcomm
adapter.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataBind()
End Sub
|