using (var conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Policias.accdb")) using (var cmd = conn.CreateCommand()) { cmd.CommandText = "SELECT contain from section "; cmd.Parameters. conn.Open(); cmd.ExecuteNonQuery(); int rowsAffected = cmd.ExecuteNonQuery(); if (rowsAffected == 1) { MessageBox.Show("Success"); } else { MessageBox.Show(string.Format("{0} Rows Affected", rowsAffected)); } }