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. General Programming
  3. C#
  4. function rectification

function rectification

Scheduled Pinned Locked Moved C#
sharepointquestion
4 Posts 3 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.
  • S Offline
    S Offline
    Sonia Gupta
    wrote on last edited by
    #1

    i am witing the following function StoredProcedureInformation is a class i want to eturn it. public StoredProcedureInformation ReturnStoredProcedureInformation(int length) { StoredProcedureInformation[] sp = new StoredProcedureInformation[length]; return sp; } Am i right?

    Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

    P N 2 Replies Last reply
    0
    • S Sonia Gupta

      i am witing the following function StoredProcedureInformation is a class i want to eturn it. public StoredProcedureInformation ReturnStoredProcedureInformation(int length) { StoredProcedureInformation[] sp = new StoredProcedureInformation[length]; return sp; } Am i right?

      Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      No. You are trying to return an array of StoredProcedureInformation objects but the return value of your method is defined as a single instance of a StoredProcedureInformation object. You should change your code to:

      public StoredProcedureInformation[] ReturnStoredProcedureInformation(int length)
      {
      StoredProcedureInformation[] sp = new StoredProcedureInformation[length];
      return sp;
      }

      Paul Marfleet

      S 1 Reply Last reply
      0
      • S Sonia Gupta

        i am witing the following function StoredProcedureInformation is a class i want to eturn it. public StoredProcedureInformation ReturnStoredProcedureInformation(int length) { StoredProcedureInformation[] sp = new StoredProcedureInformation[length]; return sp; } Am i right?

        Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

        N Offline
        N Offline
        Nissim Salomon
        wrote on last edited by
        #3

        Hi If you want to return StoredProcedureInformation class instance you need to construct an unstance of this class and return it in your code you construct an array of StoredProcedureInformation and return the array instance.

        1 Reply Last reply
        0
        • P pmarfleet

          No. You are trying to return an array of StoredProcedureInformation objects but the return value of your method is defined as a single instance of a StoredProcedureInformation object. You should change your code to:

          public StoredProcedureInformation[] ReturnStoredProcedureInformation(int length)
          {
          StoredProcedureInformation[] sp = new StoredProcedureInformation[length];
          return sp;
          }

          Paul Marfleet

          S Offline
          S Offline
          Sonia Gupta
          wrote on last edited by
          #4

          ThanQ

          Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

          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