if (cmbCampo.Text == "FECHA Y HORA")
{
try
{
NpgsqlConnection cn = new NpgsqlConnection("SERVER=localhost;PORT=5432;UID=postgres;PWD=damaris;DATABASE=ProyectoAsistenciaCCB;");
cn.Open();
NpgsqlDataAdapter sda = new NpgsqlDataAdapter("SELECT grupo, nombre_y_apellidos, id_usuario, fecha_y_hora FROM public.reportes WHERE fecha_y_hora LIKE '" + txtBuscar.Text + "%' ", cn);
dt = new DataTable();
sda.Fill(dt);
dgvAsistencia.DataSource = dt;
cn.Close();
cn.Dispose();
}
catch (Exception ex)
{
MessageBox.Show("Error" + ex);