G
Guest
I have altered to code to read as follows
public void BindSystemCodeList(
int i = 0
sysCodeList.DataSource = CreateSystemCodeListDataSource()
int count = CreateSystemCodeListDataSource().Count
for (i = 0; i <= count; i++
sysCodeList.Items.Text = "text here"
sysCodeList.Items.Value = "Value" + " - " + "Valdesc"
for (i = 0; i <= count; i++
string[] str = sysCodeList.Items.Value.ToString().Split('-')
Now when I run the program I get the following error
Server Error in '/FiveYearPlan' Application
-------------------------------------------------------------------------------
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: inde
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection
Parameter name: index
System.Collections.ArrayList.get_Item(Int32 index) +9
System.Web.UI.WebControls.ListItemCollection.get_Item(Int32 index) +1
FiveYearPlan.defaultForm.BindSystemCodeList() +7
FiveYearPlan.defaultForm.Page_Load(Object sender, EventArgs e) +16
System.Web.UI.Control.OnLoad(EventArgs e) +6
System.Web.UI.Control.LoadRecursive() +3
System.Web.UI.Page.ProcessRequestMain() +73
-------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Can anyone help me with this error
Thanks
Dav
public void BindSystemCodeList(
int i = 0
sysCodeList.DataSource = CreateSystemCodeListDataSource()
int count = CreateSystemCodeListDataSource().Count
for (i = 0; i <= count; i++
sysCodeList.Items.Text = "text here"
sysCodeList.Items.Value = "Value" + " - " + "Valdesc"
for (i = 0; i <= count; i++
string[] str = sysCodeList.Items.Value.ToString().Split('-')
Now when I run the program I get the following error
Server Error in '/FiveYearPlan' Application
-------------------------------------------------------------------------------
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: inde
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection
Parameter name: index
System.Collections.ArrayList.get_Item(Int32 index) +9
System.Web.UI.WebControls.ListItemCollection.get_Item(Int32 index) +1
FiveYearPlan.defaultForm.BindSystemCodeList() +7
FiveYearPlan.defaultForm.Page_Load(Object sender, EventArgs e) +16
System.Web.UI.Control.OnLoad(EventArgs e) +6
System.Web.UI.Control.LoadRecursive() +3
System.Web.UI.Page.ProcessRequestMain() +73
-------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Can anyone help me with this error
Thanks
Dav