viernes, 31 de enero de 2020

error al leer nodo xml

Unexpected end of file has occurred. The following elements are not closed: nodo, Config. Line 1, position 25.

No utilizar Pipe "|" en el contenido del nodo

jueves, 30 de enero de 2020

Eliminar espacios/formato entre nodos xml

ejemplo: <TED version="1.0">" & vbCrLf & "  <DD>" & vbCrLf & "    <RE>123-4</RE>


Public Function str_ted_trim(ByVal str As String) As String
            Dim doc As XDocument = XDocument.Parse(str, LoadOptions.None)
            str = doc.ToString(SaveOptions.DisableFormatting)
            Return str
        End Function


<TED version="1.0"><DD> <RE>123-4</RE>


fuente

miércoles, 29 de enero de 2020

dataset itemarray to array

String.Join(separador, dr.ItemArray.Select(Function(x) x.ToString()).ToArray)


remover elemento de un array por su indice


Dim index_remove As Integer = 3

array = array.Where(Function(x, index) index <> index_remove).ToArray

fuente

viernes, 24 de enero de 2020

viernes, 10 de enero de 2020

jueves, 9 de enero de 2020

Advertencia: valor NULL eliminado por el agregado u otra operación SET

Advertencia: valor NULL eliminado por el agregado u otra operación SET

Warning: Null value is eliminated by an aggregate or other SET operation


select max(cast(null as int))
go


solución:
sum(case when t2.id_DTE is null then 0 else 1 end) as aceptado

fuente

order by vista



SELECT     TOP (100) PERCENT

CREATE VIEW ejemploVista AS SELECT TOP 100 PERCENT * FROM procesos ORDER BY id DESC GO


fuente

lenguages sql

select langid, alias from sys.syslanguages


agregar día de la semana consulta sql

FORMAT(CAST(t1.fecha_creacion_registro AS DATETIME2),'dddd') AS [día],
FORMAT(CAST(t1.fecha_creacion_registro AS DATETIME2),'dddd','en-US') AS [día],
FORMAT(CAST(t1.fecha_creacion_registro AS DATETIME2),'dddd','es-es') AS [día],

DATENAME(DW,CAST(t1.fecha_creacion_registro AS DATE)) sql 2008



fuente
fuente2

miércoles, 8 de enero de 2020

alinear texto cabecera datagridview


 Public Sub alinear_texto_cabecera()
        For Each col As DataGridViewColumn In DataGridView1.Columns
            col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
        Next
    End Sub


fuente