private void showreportButton_Click(object sender, EventArgs e) { DateTime fromDate = fromdateTimePicker.Value; fromDate = fromDate.Date; DateTime toDate = todateTimePicker.Value; toDate = toDate.Date; toDate = toDate.AddDays(1); toDate = toDate.AddSeconds(-1); List <Transaction1> aTransactions = new List <Transaction1>(); StoreDAO aStoreDao = new StoreDAO(); if (categoryRadioButton.Checked) { aTransactions = aStoreDao.GetOtherTransactionBydate(fromDate, toDate, Convert.ToInt32(categorycomboBox.SelectedValue)); } else if (transactionRadioButton.Checked) { aTransactions = aStoreDao.GetOtherTransactionBydateAndTransactionType(fromDate, toDate, transactionTypeComboBox.Text); } otherdataGridView.DataSource = aTransactions; }