S
sivam.solai
Public Function GetTopLevelThreadName(ByVal ThreadID As Integer) As
SqlDataReader
Sp_Datasql = "WS_Get_TopLevelThreadName"
SqlParam = New SqlParameter(0) {}
Try
SqlParam(0) = New SqlParameter("@ThreadID", SqlDbType.Int)
SqlParam(0).Value = ThreadID
MyConnnection = GetConnection()
MyReader = SqlHelper.ExecuteReader(MyConnnection,
CommandType.StoredProcedure, Sp_Datasql, SqlParam)
Catch ex As Exception
Finally
If Not MyConnnection Is Nothing Then
CType(MyConnnection, IDisposable).Dispose()
End If
End Try
Return MyReader
End Function
i call above Function in Thread.aspx File code is below
MyReader = MyForum.GetTopLevelThreadName(thisThreadId)
Public MyReader As SqlDataReader
While MyReader.Read()
threadLink.NavigateUrl = "topicView.aspx?id=" &
MyReader("psRelBcId")
threadLink.Text =
myIncludes.getTopicName(MyReader("psRelBcId"))
topThreadSubject.Text = MyReader("psSubject")
End While
this use above code i got Error
Invalid attempt to Read when reader is closed.
pls advise me
SqlDataReader
Sp_Datasql = "WS_Get_TopLevelThreadName"
SqlParam = New SqlParameter(0) {}
Try
SqlParam(0) = New SqlParameter("@ThreadID", SqlDbType.Int)
SqlParam(0).Value = ThreadID
MyConnnection = GetConnection()
MyReader = SqlHelper.ExecuteReader(MyConnnection,
CommandType.StoredProcedure, Sp_Datasql, SqlParam)
Catch ex As Exception
Finally
If Not MyConnnection Is Nothing Then
CType(MyConnnection, IDisposable).Dispose()
End If
End Try
Return MyReader
End Function
i call above Function in Thread.aspx File code is below
MyReader = MyForum.GetTopLevelThreadName(thisThreadId)
Public MyReader As SqlDataReader
While MyReader.Read()
threadLink.NavigateUrl = "topicView.aspx?id=" &
MyReader("psRelBcId")
threadLink.Text =
myIncludes.getTopicName(MyReader("psRelBcId"))
topThreadSubject.Text = MyReader("psSubject")
End While
this use above code i got Error
Invalid attempt to Read when reader is closed.
pls advise me