P
prince -=nore=-
I have a page, where I'm retrieving a file location from a database and
outputting it's contents (HTML) onto a web page.
On the aspx page, I have referred to the code behind it using the line
below. This is where I'm getting the "Object reference not set to an
instance.." error
<% response.writefile(thelink())%>.
The function that line is referring to is below. The record is being
retrieved from the database according to its querystring.
Function thelink() As Object
Dim tow As String
tow = Request.QueryString("tow")
If tow <> "" Then
viewstate("tow") = "@" & tow
CmdIncLink.Parameters.Item("@tow").Value = tow
Dim tow_reader As SqlDataReader
Try
nsqlconnn.Open()
tow_reader = CmdIncLink.ExecuteReader
Do While tow_reader.Read
Return tow_reader("inclink")
Loop
nsqlconnn.Close()
Catch ex As Exception
End Try
End If
End Function
Thanks,
outputting it's contents (HTML) onto a web page.
On the aspx page, I have referred to the code behind it using the line
below. This is where I'm getting the "Object reference not set to an
instance.." error
<% response.writefile(thelink())%>.
The function that line is referring to is below. The record is being
retrieved from the database according to its querystring.
Function thelink() As Object
Dim tow As String
tow = Request.QueryString("tow")
If tow <> "" Then
viewstate("tow") = "@" & tow
CmdIncLink.Parameters.Item("@tow").Value = tow
Dim tow_reader As SqlDataReader
Try
nsqlconnn.Open()
tow_reader = CmdIncLink.ExecuteReader
Do While tow_reader.Read
Return tow_reader("inclink")
Loop
nsqlconnn.Close()
Catch ex As Exception
End Try
End If
End Function
Thanks,