protected void exportBtn_click(object sender, EventArgs e) { //ten fields for export string[] columnHeaderList = new string[]{"Event, Venue, EventDate, EventTime, Quantity, Section, Row, SeatFrom, SeatThru, Notes, Cost"}; List<List<string>> exportList; mySqlConnector mySqlConn = new mySqlConnector(); if (mySqlConn.isInitialized()) { exportList = mySqlConn.exportLatestUploads(); if (exportList.Count < 1) { noExports.Text = "Nothing to export."; noExports.Visible = true; } else { List<string> exportItem = exportList[0]; if (exportItem[0].IndexOf("Error:") > -1) { displayFormErrors(exportList[0].ToString()); } else { mySqlConn.deInitialize(); showPendingInventoryExports(); CSVExporter csvExport = new CSVExporter(exportList, columnHeaderList); } } mySqlConn.deInitialize(); } else { displayFormErrors("Error connecting to database!"); } }