Article View: borland.public.csharpbuilder.language.csharp
Article #381HandleError\Function
From: Jeff
Date: Tue, 03 May 2005 14:57
Date: Tue, 03 May 2005 14:57
33 lines
2020 bytes
2020 bytes
I have the following function that uses an oclPSHandle to look up a
price in the database. When I compile it I get an error on the
oclPrice.Expression line:
[C# Error] FrmQuote.aspx.cs(559): 'CDMOnline.TFrmQuote.oclPrice' denotes
a 'field' where a 'class' was expected.
I have other expression and oclPSHandles in the same form that work as
expected. They are in events of the web form.
public static double GetPrice(bool IsCab, string aDS, string aCabNo)
{
double aPrice = 0;
oclPrice.Expression =
"DoorStyles.AllInstances->select(description='" + aDS +
"').ItemPrice.Cabinets->select(pCode='" + aCabNo + "').ItemPrice.price";
oclPrice.Execute();
IElementCollection aP = (IElementCollection)oclPrice.Element;
for (int i = 0; i < aP.Count; i++)
{
ItemPrice aPR = (ItemPrice) aP[i].AsObject;
aPrice = aPR.price;
}
return aPrice;
}
TIA
Technical Details
Message-ID:
<42779179$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!63.218.45.11.MISMATCH!newshosting.com!nx02.iad01.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,5846d31c585885e4,start X-Google-Attributes: gid1efe35,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 03 May 2005 09:57:56 -0500 From: Jeff <jbarr62307@worldnet.att.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.csharpbuilder.language.csharp Subject: HandleError\Function Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 12.240.53.183 Message-ID: <42779179$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1115132281 12.240.53.183 (3 May 2005 07:58:01 -0700) Lines: 33 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!63.218.45.11.MISMATCH!newshosting.com!nx02.iad01.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail