From 6b6947e5691b77850f1fc824cc0fab7fa096a080 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 30 Mar 2020 14:54:09 -0700 Subject: [PATCH] validador si la consulta en um tiene contenido o no --- Ashx/SIGWeb.ashx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 890fd766c..274fb8741 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -565,7 +565,11 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState DTUM = DTUM.Where((Function(a) a!ClaveNombre.ToString.ToLower Like ("*" + Name.ToLower + "*"))) End If - DtPSRetorno = New DataView(DTUM.OrderBy(Function(a) a!Nombre).CopyToDataTable).ToTable(True, {"CveSATUnidadMedida", "ClaveNombre"}) + If DTUM.Count > 0 Then + DtPSRetorno = New DataView(DTUM.OrderBy(Function(a) a!Nombre).CopyToDataTable).ToTable(True, {"CveSATUnidadMedida", "ClaveNombre"}) + Else + DtPSRetorno = Nothing + End If If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then DtPSRetorno.Columns("CveSATUnidadMedida").ColumnName = "id"