G
Guest
Can someone tell me why the value of my Boolean is always false!
Even after I have declared that my variable iNews should equal TRUE it seems
to remain false...
Can some please explain why...
Thanks
Dim iNews As Boolean
Private Function GetDocument() As String
Dim ds As DataSet
If Request.ServerVariables("HTTP_REFERER") =
"http://localhost/cpncms_v1/cms/viewpage.aspx" Then
ds = GetDataSet(("SELECT content FROM tblPageContent WHERE
pageID=" + rowID.ToString()))
iNews = True
ElseIf Request.ServerVariables("HTTP_REFERER") =
"http://localhost/cpncms_v1/cms/news/pgeEditor.aspx" Then
ds = GetDataSet(("SELECT content FROM tblNewsArchive WHERE
newsID=" + rowID.ToString()))
iNews = False
End If
Dim table As DataTable = ds.Tables(0)
Dim row As DataRow = table.Rows(0)
Dim doc As String = row("content").ToString()
Return doc
ds.Dispose()
End Function 'GetDocument
Private Sub UpdateDocument(ByVal doc As String)
Dim strSQL As String = ""
If iNews = True Then
strSQL += "UPDATE tblPageContent SET content='"
strSQL += (doc.Replace(Chr(39), Chr(39) + Chr(39)))
strSQL += "' WHERE pageID=" + rowID.ToString()
RunQuery((strSQL))
Else
strSQL += "UPDATE tblNewsArchive SET content='"
strSQL += (doc.Replace(Chr(39), Chr(39) + Chr(39)))
strSQL += "' WHERE newsID=" + rowID.ToString()
RunQuery((strSQL))
End If
iNews = Nothing
End Sub 'UpdateDocument
Even after I have declared that my variable iNews should equal TRUE it seems
to remain false...
Can some please explain why...
Thanks
Dim iNews As Boolean
Private Function GetDocument() As String
Dim ds As DataSet
If Request.ServerVariables("HTTP_REFERER") =
"http://localhost/cpncms_v1/cms/viewpage.aspx" Then
ds = GetDataSet(("SELECT content FROM tblPageContent WHERE
pageID=" + rowID.ToString()))
iNews = True
ElseIf Request.ServerVariables("HTTP_REFERER") =
"http://localhost/cpncms_v1/cms/news/pgeEditor.aspx" Then
ds = GetDataSet(("SELECT content FROM tblNewsArchive WHERE
newsID=" + rowID.ToString()))
iNews = False
End If
Dim table As DataTable = ds.Tables(0)
Dim row As DataRow = table.Rows(0)
Dim doc As String = row("content").ToString()
Return doc
ds.Dispose()
End Function 'GetDocument
Private Sub UpdateDocument(ByVal doc As String)
Dim strSQL As String = ""
If iNews = True Then
strSQL += "UPDATE tblPageContent SET content='"
strSQL += (doc.Replace(Chr(39), Chr(39) + Chr(39)))
strSQL += "' WHERE pageID=" + rowID.ToString()
RunQuery((strSQL))
Else
strSQL += "UPDATE tblNewsArchive SET content='"
strSQL += (doc.Replace(Chr(39), Chr(39) + Chr(39)))
strSQL += "' WHERE newsID=" + rowID.ToString()
RunQuery((strSQL))
End If
iNews = Nothing
End Sub 'UpdateDocument