473,473 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

trivial ? build error

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.


Nov 19 '05 #1
4 1062
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.


Nov 19 '05 #2
Carlos,

Have you just moved from vb to vc#?

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

Eliyahu

"Carlos" <ch******@yahoo.com> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl...
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.


Nov 19 '05 #3
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" <ch******@yahoo.com> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl...
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.


Nov 19 '05 #4
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/...omparison.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" <ch******@yahoo.com> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl...
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.


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Brian Patterson | last post by:
I have noticed in the book of words that hasattr works by calling getattr and raising an exception if no such attribute exists. If I need the value in any case, am I better off using getattr...
2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
10
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a...
5
by: Alfonso Morra | last post by:
Hi, I've written a very simple Simpleton design pattern class template. This was supposed to illustrate a point. Although it compiles without nay errors, I get link errors (unresolved external),...
0
by: ktelep | last post by:
I'm trying to build python 2.4.2 on AIX 5.3 with the IBM xlC compiler as per the notes in the AIX Readme file. Basically my make fails with the errors listed below. I'm calling configure with:...
4
by: Edward Diener | last post by:
When I try to find out if a trivial event has handlers, by comparing the event to nullptr, I get compiler error C3918. So my natural question is how does one test a trivial event for handlers ?
1
by: Ted Zeng | last post by:
Hi, I am new to Python. I am trying to build MySQLdb for my PowerPC PowerMac. I just downloaded the source last week and tried to build it. But I got the error messages as follow. I checked and...
5
by: michael.d.pedersen | last post by:
Hello group, I am new to Visual C++ 8 and have a seemingly trivial problem using namespaces. The scenario: I have two classes, TestClass1 and TestClass2, in the namespace Test. I would like to...
6
by: Soren | last post by:
Hi! I'm trying to extend my python program with some C++ code. Right now I've spent hours just trying to get boost to work! I'm trying to get the example hello.cpp to work. Using Windows XP...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.