Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear All Experts,
I got some errors in this code
C#
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
Posted
Updated 2-Nov-11 2:29am
v2
Comments
Amir Mahfoozi 2-Nov-11 8:50am    
Runtime error ? Compile error ? and what message did you get ?
Menon Santosh 2-Nov-11 10:33am    
Where is the error ?

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:
C#
int[] a=new int[array_size];
 
Share this answer
 
v2
You are not casting your Session["Answered"] to the appropriate type or checking if it is null or not before using it
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900