Results 1 to 4 of 4

Thread: Getting error methods cannot be declared as static

  1. #1
    Geek_Guest
    Guest

    Getting error methods cannot be declared as static

    When I am trying to write a fucntion as static it is showing me an error called as methods cannot be declared as static..public static function whereami (byval value as boolean) this is giving me an error..!!

    can sombody help..
    thanks,
    Swiss

    Question asked by visitor swiss


  2. #2
    Junior Member
    Join Date
    Jun 2007
    Answers
    3

    Re: Getting error methods cannot be declared as static

    Try using the "Shared"-keyword instead of static.

    E.g. Public Shared Function Foo(ByVal value as Boolean) as Boolean


  3. #3
    Contributing Member
    Join Date
    May 2007
    Answers
    60

    Re: Getting error methods cannot be declared as static

    static is replaced with shared in vb.net but in c# static only..


  4. #4
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Getting error methods cannot be declared as static

    It seems u inherited from the old VB 6.0. thats why this problem.

    use SHARED if writing in vb.net
    but still can use the same STATIC keyword if u are into c#


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact