private void BuscarNroCompr() { string fechaInicio = ""; string fechaFin = ""; int totalCan = 0; if (rbAperturaCaja.Checked == true) { //fecIn = Convert.ToDateTime(frmPrincipal.f1.lblFechaApertura.Text); //fechaInicio = fecIn.ToString("yyyy-MM-dd hh:mm:ss"); fechaInicio = frmPrincipal.f1.lblFechaApertura.Text; // fechaFin = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); fechaFin = DateTime.Now.ToString(); } else if (rbElegir.Checked == true) { fechaInicio = dtpFechaInicio.Value.ToString("yyyy-MM-dd" + " 00:00:00"); fechaFin = dtpFechaFin.Value.ToString("yyyy-MM-dd" + " 23:59:59"); } this.dataListado.DataSource = NVenta.BuscarReporteVentaFechas_NroCompr(this.txtBuscar.Text.Trim(), Convert.ToDateTime(fechaInicio), Convert.ToDateTime(fechaFin)); this.ocultarColumnas(); lblTotal.Text = "Total de Registros: " + Convert.ToString(dataListado.Rows.Count); }