How do I use this code? I tried using SQL Management Studio to excute the script and received the following errors:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'Public'.
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near 'Nothing'.
Msg 102, Level 15, State 1, Line 5
Incorrect syntax near 'Nothing'.
Msg 1038, Level 15, State 4, Line 6
An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Add a name or single space as the alias name.
Msg 178, Level 15, State 1, Line 11
A RETURN statement with a return value cannot be used in this context.
Msg 156, Level 15, State 1, Line 13
Incorrect syntax near the keyword 'SET'.
Msg 102, Level 15, State 1, Line 17
Incorrect syntax near 'Nothing'.
Msg 156, Level 15, State 1, Line 23
Incorrect syntax near the keyword 'SET'.
DSlage wrote
I think the problem is with the cookie code. I used the following code to overcome the "Object reference not set" problem.
Public Property SelectedCategory() As String
Get
If _SelectedCategory Is Nothing Then
Dim objCookie As HttpCookie = Request.Cookies("DNNEvents")
If objCookie Is Nothing Then
_SelectedCategory = ""
Else
Me.SelectedCategory = objCookie.Values("Cat" & ModuleId.ToString)
End If
End If
Return _SelectedCategory
End Get
Set(ByVal Value As String)
Try
_SelectedCategory = Value
Dim objCookie As HttpCookie = Request.Cookies("DNNEvents")
If objCookie Is Nothing Then objCookie = New HttpCookie("DNNEvents")
objCookie.Values("Cat" & ModuleId.ToString) = _SelectedCategory
Response.Cookies.Add(objCookie)
Catch ex As Exception
End Try
End Set
End Property