Anish Khan

Anish Khan

  • NA
  • 25
  • 0

Geting error: index was outside the bounds of the array

Feb 10 2010 1:39 AM

Hi All,
this is my code to store multiple selected item from a list box in windows application and I am geting error.
Already i have declared array size.
string[] ItemArray = new string[20];
for (int i = 0; i <= listBox1.SelectedItems.Count; i++)
{
txtmessage.Text = ((DataRowView)listBox1.SelectedItem).Row.ItemArray[i].ToString();
}
Please help me
Thanks

Answers (3)