I have some code which loops through my data table and i used the item variable well. But my problem is i needs to iterate through, it needs to be + 1 from the last number it was on. It needs to come out of its loops once the foreach has finished.
private void button2_Click(object sender, EventArgs e)
{
CreateExcelDoc excell_app = new CreateExcelDoc();
//creates the main header
COLUMNSTableAdapter adapterTableName = new COLUMNSTableAdapter();
DataTable table = adapterTableName.GetData(tableName); // Get the data table.
foreach (DataRow row in table.Rows) // Loop over the rows.
{
foreach (var item in row.ItemArray) // Loop over the items.
{
for (int i = 1; i < 30; i++)
{
excell_app.createHeaders(1, 1, "" + item + "", i, i, 1, "black", false, 10, "n");
}
}
}
}