trivial ? build error

Discussion in 'ASP .Net' started by Carlos, Feb 9, 2005.

  1. Carlos

    Carlos Guest

    Hi all,

    II am getting a build error for the folowing statement:

    String sGetVarVal = Request.QueryString("myvar");

    error:

    System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
    was expected

    I though that the statement is correct!! have seen it a lot of times. Can
    anyone help on this? Thanks



    Carlos.
    Carlos, Feb 9, 2005
    #1
    1. Advertising

  2. Use [ ] - this squre brackets instead of this ( )

    Regards
    Thangam,


    "Carlos" wrote:

    > Hi all,
    >
    > II am getting a build error for the folowing statement:
    >
    > String sGetVarVal = Request.QueryString("myvar");
    >
    > error:
    >
    > System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
    > was expected
    >
    > I though that the statement is correct!! have seen it a lot of times. Can
    > anyone help on this? Thanks
    >
    >
    >
    > Carlos.
    >
    >
    >
    >
    >
    >
    >
    =?Utf-8?B?R29sZA==?=, Feb 9, 2005
    #2
    1. Advertising

  3. Carlos,

    Have you just moved from vb to vc#?

    String sGetVarVal = Request.QueryString["myvar"];

    Eliyahu

    "Carlos" <> wrote in message
    news:...
    > Hi all,
    >
    > II am getting a build error for the folowing statement:
    >
    > String sGetVarVal = Request.QueryString("myvar");
    >
    > error:
    >
    > System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
    > was expected
    >
    > I though that the statement is correct!! have seen it a lot of times. Can
    > anyone help on this? Thanks
    >
    >
    >
    > Carlos.
    >
    >
    >
    >
    >
    >
    Eliyahu Goldin, Feb 9, 2005
    #3
  4. Try String sGetVarVal = Request.QueryString["myvar"];

    You're using VB syntax in C# code.




    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en EspaƱol
    =====================

    "Carlos" <> wrote in message
    news:...
    > Hi all,
    >
    > II am getting a build error for the folowing statement:
    >
    > String sGetVarVal = Request.QueryString("myvar");
    >
    > error:
    >
    > System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
    > was expected
    >
    > I though that the statement is correct!! have seen it a lot of times. Can
    > anyone help on this? Thanks
    >
    >
    >
    > Carlos.
    >
    >
    >
    >
    >
    >
    Juan T. Llibre, Feb 9, 2005
    #4
  5. Carlos

    Karl Seguin Guest

    As others have pointed out, C# cleans up the ambiguity with respect to
    functions() and arrays[]

    If, as others have suggested, you are moving from VB.Net to C#, you might
    want to check out:
    http://www.harding.edu/USER/fmccown/WWW/vbnet_csharp_comparison.html

    Other than that my follow up to this thread has been little more than a
    "what he said" ...but makes me feel nonetheless special :)

    Karl
    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Carlos" <> wrote in message
    news:...
    > Hi all,
    >
    > II am getting a build error for the folowing statement:
    >
    > String sGetVarVal = Request.QueryString("myvar");
    >
    > error:
    >
    > System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
    > was expected
    >
    > I though that the statement is correct!! have seen it a lot of times. Can
    > anyone help on this? Thanks
    >
    >
    >
    > Carlos.
    >
    >
    >
    >
    >
    >
    Karl Seguin, Feb 9, 2005
    #5
  6. Carlos

    rishibajaj

    Joined:
    Aug 25, 2006
    Messages:
    1
    use [] instead of ()
    rishibajaj, Aug 25, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Larry Smith

    Trivial resources problem (beginner)

    Larry Smith, Oct 2, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    505
    Scott Manson
    Oct 2, 2003
  2. John Timbers
    Replies:
    32
    Views:
    1,387
    Alvin Bruney
    Nov 8, 2003
  3. HK
    Replies:
    0
    Views:
    418
  4. Alfonso Morra
    Replies:
    5
    Views:
    337
    Alfonso Morra
    Aug 31, 2005
  5. baibaichen

    trivial or non-trivial object

    baibaichen, Jan 12, 2006, in forum: C++
    Replies:
    3
    Views:
    879
    osmium
    Jan 12, 2006
Loading...

Share This Page