private void btnAdjusted_Click(object sender, EventArgs e)
{
con = new OleDbConnection(conString);
if (comboBoxSelectSuspenseAccount.Text != "")
{
var query = "SELECT * FROM LalData " +
" WHERE " +
" (PaymentDate between '" + dtpFirstDate.Text.ToString() + "' AND '" + dtpLastDate.Text.ToString() + "')" +
"AND " +
"SuspenseAccount like '" + comboBoxEnterSuspenseAccount.SelectedItem.ToString() + "'";
con.Open();
if (dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[10].ToString() != "")
{
adapter = new OleDbDataAdapter(query, con);
dt = new DataTable();
adapter.Fill(dt);
dataGridView1.DataSource = dt;
dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[0];
btnSubmit.Enabled = false;
con.Close();
}
}