C#
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 { 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

Posted Jun 14, 2011, 3:15 AM EDT
ds.Tables[0].Rows[comboBox1.SelectedIndex][i].ToString() to get the value. Please check that once.
Suthish NairRank #92 · 22.8K reputationPosted Jun 14, 2011, 3:30 AM EDT
Abhimanyu K VatsaRank #14 · 51.7K reputationPosted Jun 14, 2011, 3:45 AM EDT