{
public K1()
{
I1Value = new I1[] { };
}
private I1[] I1Value;
public I1[] K1_Method
{
get
{
return this.I1Value;
}
set
{
this.I1Value = value;
}
}
}
public class I1
{
public I1()
{
Cd = new InstCode();
}
private InstCode cdField;
private string instField;
public InstCode Cd
{
get
{
return this.cdField;
}
set
{
this.cdField = value;
}
}
public string InstrInf
{
get
{
return this.instField;
}
set
{
this.instField = value;
}
}
}
public enum InstCode
{
A,
B,
C,
D,
}
protected void Page_Load(object sender, EventArgs e)
{
try
{
K1 objK1 = new K1();
objK1.K1_Method[0].Cd = ((InstCode)Enum.Parse(typeof(InstCode), "D"));
//objK1.K1_Method.
}
catch (Exception ex)
{
}
}
{
try
{
K1 objK1 = new K1();
objK1.K1_Method[0].Cd = ((InstCode)Enum.Parse(typeof(InstCode), "D"));
//objK1.K1_Method.
}
catch (Exception ex)
{
}
}
As Above code when i,m trying to access the objK1.K1_Method[0].Cd = ((InstCode)Enum.Parse(typeof(InstCode), "D")); showing idex outside error how can i set .
Manas MohapatraPosted Oct 24, 2016, 5:40 AM