Index was outside the bounds of the array.
public class K1<br />{<br /> public K1()<br /> {<br /> I1Value = new I1[] { };<br /> }<br /><br /> private I1[] I1Value;<br /><br /> public I1[] K1_Method<br /> {<br /> get<br /> {<br /> return this.I1Value;<br /> }<br /> set<br /> {<br /> this.I1Value = value;<br /> }<br /> }<br />}<br />public class I1<br />{<br /> public I1()<br /> {<br /> Cd = new InstCode();<br /> }<br /> private InstCode cdField;<br /><br /> private string instField;<br /><br /> public InstCode Cd<br /> {<br /> get<br /> {<br /> return this.cdField;<br /> }<br /> set<br /> {<br /> this.cdField = value;<br /> }<br /> }<br /> public string InstrInf<br /> {<br /> get<br /> {<br /> return this.instField;<br /> }<br /> set<br /> {<br /> this.instField = value;<br /> }<br /> }<br />}<br /><br />public enum InstCode<br />{<br /> A,<br /> B,<br /> C,<br /> D,<br /><div>} </div><div> protected void Page_Load(object sender, EventArgs e)<br /> {<br /> try<br /> {<br /> <br /> K1 objK1 = new K1();<br /> <br /> objK1.K1_Method[0].Cd = ((InstCode)Enum.Parse(typeof(InstCode), "D"));<br /> //objK1.K1_Method.<br /> }<br /> catch (Exception ex)<br /> {<br /><br /> }<br /> }</div><div> </div><div> 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 .</div><div> </div><div> </div>