这个宣言是正确的吗 [英] Is this Declaration is Correct
本文介绍了这个宣言是正确的吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尊敬的所有专家,
我在此代码中遇到了一些错误
Dear All Experts,
I got some errors in this code
int[] a = new [];
dt = Session["Answered"];
View v = this.View1;
Label l = default(Label);
l = (Label)v.FindControl("Label1");
l.Text = dt.Rows[ctr]["Serial"] + ".";
l = (Label)v.FindControl("Label2");
l.Text = dt.Rows[ctr]["question"];
感谢您的宝贵重放.
Thanks for your valuable replay
推荐答案
您能告诉您您遇到了什么错误吗?
首先检查您是否没有为数组提到名称,而是简单地添加了新名称,
修改为:
can u tell what error you are having ?
first check that u didn''t mentioned name for the array instead simply u added new,
edit it as:
int[] a=new int[array_size];
您没有将Session["Answered"]
强制转换为适当的type
,也没有检查是否为null
使用之前
You are not casting yourSession["Answered"]
to the appropriatetype
or checking if it isnull
or not before using it
这篇关于这个宣言是正确的吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文