Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. Very strange issue

Very strange issue

Scheduled Pinned Locked Moved SharePoint
helpdatabasequestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aptiva Dave
    wrote on last edited by
    #1

    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.ToString

    I 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 2 Replies Last reply
    0
    • A Aptiva Dave

      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.ToString

      I 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 Offline
      I Offline
      Ingo
      wrote on last edited by
      #2

      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.

      A 1 Reply Last reply
      0
      • I Ingo

        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.

        A Offline
        A Offline
        Aptiva Dave
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • A Aptiva Dave

          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.ToString

          I 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 Offline
          I Offline
          Ingo
          wrote on last edited by
          #4

          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.

          A 1 Reply Last reply
          0
          • I Ingo

            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.

            A Offline
            A Offline
            Aptiva Dave
            wrote on last edited by
            #5

            Dang! Looked over that code a hundred times and didn't see that! Thanks!

            I 1 Reply Last reply
            0
            • A Aptiva Dave

              Dang! Looked over that code a hundred times and didn't see that! Thanks!

              I Offline
              I Offline
              Ingo
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups