str2 += strListItems[i] + ":" + ds.Tables[0].Rows[comboBox1.SelectedIndex][i].ToString() + "\r\n";
indexoutofrange Exception
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;
ds.Tables[0].Rows.Count
strListItems
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)