请帮助我正在调用一个显示错误的方法 [英] Plz help i am calling a method it's shows error
本文介绍了请帮助我正在调用一个显示错误的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个wcf服务,该服务正在返回方法的输出.我正在这样称呼一个领域
Hi,
I have a wcf service which was returning the output of a method. i am calling a field in that like this
label.text = objRec.System[].cLLI ;
它向我抛出一个错误语法错误;期望值" .... in]"
问候,
Basha
It was throwing me a error "syntax error; value expected"....in "]"
Regards,
Basha
推荐答案
您必须在两个方括号之间放置一些内容,例如[0] [i]
You have to put something in between two square brackets e.g. [0] [i]
从您的示例中可以看到,objRec.System
是IList或数组类型,因此您应指定想要cLLI属性来自的项的索引. br/> 例如:
What I can see from your example is thatobjRec.System
is an IList or Array type, so you should specify the index of the item your want the cLLI Property from.
For example:
label.text = objRec.System[0].cLLI ; // Gets the first item in the list. If there are no items throws a NullReferenceException.
这篇关于请帮助我正在调用一个显示错误的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文