Very strange issue
-
I've got some backend code on an app page that I'm using to count objects in a list. When I run the following code:
Dim query As SPQuery = New SPQuery
query.Query = "<Where><Eq><FieldRef Name='PlaneID' /><Value Type='Text'>" & id & _
"</Value></Eq><Where>"
Dim flItems As SPListItemCollection = fuelList.GetItems(query)
Dim count As Integer = 0
count = flItems.Count
Return count.ToStringI run this code from the page using a web method. Through trail and error I have narrowed down the offending code to
count = flItems.Count
The method keeps failing and return a status code of 500. Can someone tell me why?
-
I've got some backend code on an app page that I'm using to count objects in a list. When I run the following code:
Dim query As SPQuery = New SPQuery
query.Query = "<Where><Eq><FieldRef Name='PlaneID' /><Value Type='Text'>" & id & _
"</Value></Eq><Where>"
Dim flItems As SPListItemCollection = fuelList.GetItems(query)
Dim count As Integer = 0
count = flItems.Count
Return count.ToStringI run this code from the page using a web method. Through trail and error I have narrowed down the offending code to
count = flItems.Count
The method keeps failing and return a status code of 500. Can someone tell me why?
Aptiva Dave wrote:
The method keeps failing and return a status code of 500. Can someone tell me why?
May be flItems is null. Check if flItems is not null, before you set count to flItems.Count.
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
-
Aptiva Dave wrote:
The method keeps failing and return a status code of 500. Can someone tell me why?
May be flItems is null. Check if flItems is not null, before you set count to flItems.Count.
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
I did check for null and also put something into the list that flItems is getting objects from. I'm not sure what is going on, but on top of everything I can't log into the site when I try to debug on the dev server.
-
I've got some backend code on an app page that I'm using to count objects in a list. When I run the following code:
Dim query As SPQuery = New SPQuery
query.Query = "<Where><Eq><FieldRef Name='PlaneID' /><Value Type='Text'>" & id & _
"</Value></Eq><Where>"
Dim flItems As SPListItemCollection = fuelList.GetItems(query)
Dim count As Integer = 0
count = flItems.Count
Return count.ToStringI run this code from the page using a web method. Through trail and error I have narrowed down the offending code to
count = flItems.Count
The method keeps failing and return a status code of 500. Can someone tell me why?
Aptiva Dave wrote:
query.Query = "<Where><Eq><FieldRef Name='PlaneID' /><Value Type='Text'>" & id & _ "</Value></Eq><Where>"
There is a "/" missing:
"<**/**Where>"
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
-
Aptiva Dave wrote:
query.Query = "<Where><Eq><FieldRef Name='PlaneID' /><Value Type='Text'>" & id & _ "</Value></Eq><Where>"
There is a "/" missing:
"<**/**Where>"
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
Dang! Looked over that code a hundred times and didn't see that! Thanks!
-
Dang! Looked over that code a hundred times and didn't see that! Thanks!
Aptiva Dave wrote:
Dang! Looked over that code a hundred times and didn't see that! Thanks!
No Problem. I just saw it after you said it doesn't was the test of null. :)
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.