Venkat S

Venkat S

  • 1.5k
  • 234
  • 203.1k

Error : indexoutofrange Exception

Jun 14 2011 6:48 AM
i get error below code only str2 += strListItems[i] + ":" + ds.Tables[0].Rows[comboBox1.SelectedIndex][i].ToString() + "\r\n";  the error is indexoutofrange Exception. and my full code is string str2 = "";             string[] strListItems = { ds.Tables[0].Columns[1].ToString(), ds.Tables[0].Columns[0].ToString(), ds.Tables[0].Columns[2].ToString() };             for (int i = 0; i < ds.Tables[0].Rows.Count -1; i++)             {                 str2 += strListItems[i] + ":" + ds.Tables[0].Rows[comboBox1.SelectedIndex][i].ToString() + "\r\n";             }             textBox1.Text = str2;  Please give me any idea to  resolve it 


Thanks
VenkatS

Answers (3)