private void deleteSimulatRecordToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRow row = this.dg_overview.Rows[this.dg_overview.SelectedCells[0].RowIndex]; int type = Convert.ToInt16(row.Cells[0].Value); string startdate = (string)row.Cells[1].Value; string enddate = (string)row.Cells[2].Value; DialogResult result = MessageBox.Show("Confirm delete startdate = " + startdate + ", enddate = " + enddate, "Delete Record", MessageBoxButtons.OKCancel); if (result == DialogResult.OK) { StockSimulateSQL.ClearDB(type, Convert.ToInt32(startdate), Convert.ToInt32(enddate), "buy", "sell"); MessageBox.Show("Delete Simulate Done!"); } else { return; } this.dg_detail.Rows.Clear(); getAllResult(); }