Declaring Global variables in a WebService

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default Declaring Global variables in a WebService

    hi,
    In the webservice which iam writing, i have to declare a an array
    which has to be global. How and where shuld i declare it.
    I declared it as

    public static bool[] Busy = new bool[50];

    but this doesnt seem to work. This array is reinitialized everytime.


    Thanks
    sendhil
    sendhil Guest

  2. Similar Questions and Discussions

    1. dynamically declaring hidden variables
      I've created a html page with a table in it. The rows in the table are generated dynamically. Also, they can be deleted dynamically at random. Each...
    2. Declaring variables across frames
      Hey guys, When I use the LoadVars object to submit a form, and I have different variables across four frames (four page form), how do I declare...
    3. Classes and declaring variables
      Greetings, all! I have a question about classes and variables. When you are working with a class, when should you (or are required) to declare...
    4. Global variables - application variables vs include file
      What are the best methods for using global constants and variables? I've noticed that many people put all global constants in a file and include...
    5. Declaring variables with global scope (Newbie Question)!
      Hi, I am a beginner VB.NET developer and am trying to create my first ASP.NET web application. I know that in a standard Windows Form type...
  3. #2

    Default Re: Declaring Global variables in a WebService

    To keep things over calls - place it in Application["xxxx"] or use
    the Cache - wich gives you the same functionalty as Application with
    greater control of the lifetime!!

    HTH

    Manfred
    "sendhil" <report_1979@yahoo.com> schrieb im Newsbeitrag
    news:97ce4388.0311191542.4a896312@posting.google.c om...
    > hi,
    > In the webservice which iam writing, i have to declare a an array
    > which has to be global. How and where shuld i declare it.
    > I declared it as
    >
    > public static bool[] Busy = new bool[50];
    >
    > but this doesnt seem to work. This array is reinitialized everytime.
    >
    >
    > Thanks
    > sendhil

    Manni Guest

  4. #3

    Default Re: Declaring Global variables in a WebService

    If you want it to be global across all threads (all hits from different users as long as the class remains loaded), make it static.
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139