A
Allan Wenham
Hello,
I have a Intermittent error, only happens once or twice a day:
This is the basic code:
Dim strSeachLetter As String
strSeachLetter =Request.QueryString("letter")
If strSeachLetter <> "" Then
strSeachLetter.Trim()
If TypeOf strSeachLetter Is String Then
Call filterAuthorByLetter(strSeachLetter.ToString)
End If
End If
Public Sub filterAuthorByLetter(ByVal inletter As String)
'does something with the inletter
end sub
Every now and again somthing goes odd and I get:
System.InvalidCastException: Specified cast is not valid. at
mysite.WebForm1.filterAuthorByLetter(String inletter)
I don't undersatand why I am getting it as I know the input in the sub
IS a string it won't run the line otherwise, I can't get it to repleat
on my local site, it only happens on the 'live' site where I have had
to supress the error and have it email me when it fails. Other bizar
thing that might help is that when this first cropped up I was hitting
a URL such as 'mypage.aspx?letter=R' that would fail but
'mypage.aspx?letter=r' would work, after a recompile the 'R' started
working again but it seems that every now and then it falls down for
no reason. The sub doesn't care what case the letter is by the way it
makes no difference to the code in side.
Anybody got any ideas, at all, it diving me mad.
-Wenham
I have a Intermittent error, only happens once or twice a day:
This is the basic code:
Dim strSeachLetter As String
strSeachLetter =Request.QueryString("letter")
If strSeachLetter <> "" Then
strSeachLetter.Trim()
If TypeOf strSeachLetter Is String Then
Call filterAuthorByLetter(strSeachLetter.ToString)
End If
End If
Public Sub filterAuthorByLetter(ByVal inletter As String)
'does something with the inletter
end sub
Every now and again somthing goes odd and I get:
System.InvalidCastException: Specified cast is not valid. at
mysite.WebForm1.filterAuthorByLetter(String inletter)
I don't undersatand why I am getting it as I know the input in the sub
IS a string it won't run the line otherwise, I can't get it to repleat
on my local site, it only happens on the 'live' site where I have had
to supress the error and have it email me when it fails. Other bizar
thing that might help is that when this first cropped up I was hitting
a URL such as 'mypage.aspx?letter=R' that would fail but
'mypage.aspx?letter=r' would work, after a recompile the 'R' started
working again but it seems that every now and then it falls down for
no reason. The sub doesn't care what case the letter is by the way it
makes no difference to the code in side.
Anybody got any ideas, at all, it diving me mad.
-Wenham