miércoles, 31 de octubre de 2018

número notación cientifica

Dim number As Double = 0.000009
        Dim defaulnumber As String = number.ToString
        Dim numerFromString As String = number.ToString("N6")

        Dim numberFromStringFormat As String = String.Format("{0:F6}", number)

martes, 30 de octubre de 2018

Dataset

Dim ds As DataSet = get_dataset()


Public Function get_dataset() As DataSet
        Dim con As New SqlConnection(conex)
        Dim adapter As SqlDataAdapter = Nothing
        Dim ds As New DataSet()
        Dim query As String = "query sql"
        con.Open()
        Using cmd As New SqlCommand(query, con)
            cmd.Parameters.Add("@parametro1", SqlDbType.VarChar).Value = ""
            cmd.Parameters.Add("@parametro2", SqlDbType.VarChar).Value = ""
            adapter = New SqlDataAdapter(cmd)
            adapter.Fill(ds)
        End Using
        con.Close()
        Return ds
    End Function


lunes, 29 de octubre de 2018

Check ListBox

https://www.youtube.com/watch?v=VSpvB8KmCBQ

Array vacío (nada)

If array Is Nothing then
End If

Eliminar registro array

Dim variables() As String ={"a","b"}
Dim eliminar As String = "a"

variables = variables.Where(Function(x) x <> eliminar ).ToArray

fuente

jueves, 25 de octubre de 2018

mensajes error sql

select * from master.dbo.sysmessages

select * from master.dbo.sysmessages where error=102
select * from master.dbo.sysmessages where msglangid=3082

select @@LANGID

SELECT name, alias
 FROM sys.syslanguages

 SELECT * FROM sys.syslanguages

fuente
fuente2

Descargar dlls

https://www.zhaodll.co/
http://www.zhaodll.com/

Schema.ScriptDom

X:\Program Files\Microsoft Visual Studio 10.0\VSTSDB

Microsoft.Data.Schema.ScriptDom.dll
Microsoft.Data.Schema.ScriptDom.Sql.dll

sqldbtype enum

Public Function value_Type(ByVal sql_dbtype As String) As Integer
        Select Case sql_dbtype
            Case "bigint"
                Return 0
            Case "binary"
                Return 1
            Case "bit"
                Return 2
            Case "char"
                Return 3
            Case "date"
                Return 31
            Case "datetime"
                Return 4
            Case "datetime2"
                Return 33
            Case "datetimeoffset"
                Return 34
            Case "decimal"
                Return 5
            Case "float"
                Return 6
            Case "image"
                Return 7
            Case "int"
                Return 8
            Case "money"
                Return 9
            Case "nchar"
                Return 10
            Case "ntext"
                Return 11
            Case "nvarchar"
                Return 12
            Case "real"
                Return 13
            Case "smalldatetime"
                Return 15
            Case "smallint"
                Return 16
            Case "smallmoney"
                Return 17
            Case "structured"
                Return 30
            Case "text"
                Return 18
            Case "time"
                Return 32
            Case "timestamp"
                Return 19
            Case "tinyint"
                Return 20
            Case "udt"
                Return 29
            Case "uniqueidentifier"
                Return 14
            Case "varbinary"
                Return 21
            Case "varchar"
                Return 22
            Case "variant"
                Return 23
            Case "xml"
                Return 25
            Case Else
                Return -1
        End Select
    End Function

fuente

Tipo de dato INFORMATION_SCHEMA.COLUMNS

TABLE_CATALOGnvarchar(128)Table qualifier.
TABLE_SCHEMAnvarchar(128)Name of schema that contains the table.
TABLE_NAMEnvarchar(128)Table name.
COLUMN_NAMEnvarchar(128)Column name.
ORDINAL_POSITIONintColumn identification number.
Note: In SQL Server 2005, these column IDs are consecutive numbers.
COLUMN_DEFAULTnvarchar(4000)Default value of the column.
IS_NULLABLEvarchar(3)Nullability of the column. If this column allows for NULL, this column returns YES. Otherwise, NO is returned.
DATA_TYPEnvarchar(128)System-supplied data type.
CHARACTER_MAXIMUM_LENGTHintMaximum length, in characters, for binary data, character data, or text and image data.
-1 for xml and large-value type data. Otherwise, NULL is returned. For more information, see Data Types (Transact-SQL).
CHARACTER_OCTET_LENGTHintMaximum length, in bytes, for binary data, character data, or text and image data.
-1 for xml and large-value type data. Otherwise, NULL is returned.
NUMERIC_PRECISIONtinyintPrecision of approximate numeric data, exact numeric data, integer data, or monetary data. Otherwise, NULL is returned.
NUMERIC_PRECISION_RADIXsmallintPrecision radix of approximate numeric data, exact numeric data, integer data, or monetary data. Otherwise, NULL is returned.
NUMERIC_SCALEintScale of approximate numeric data, exact numeric data, integer data, or monetary data. Otherwise, NULL is returned.
DATETIME_PRECISIONsmallintSubtype code for datetime and SQL-92 interval data types. For other data types, NULL is returned.
CHARACTER_SET_CATALOGnvarchar(128)Returns master. This indicates the database in which the character set is located, if the column is character data or textdata type. Otherwise, NULL is returned.
CHARACTER_SET_SCHEMAnvarchar(128)Always returns NULL.
CHARACTER_SET_NAMEnvarchar(128)Returns the unique name for the character set if this column is character data or text data type. Otherwise, NULL is returned.
COLLATION_CATALOGnvarchar(128)Always returns NULL.
COLLATION_SCHEMAnvarchar(128)Always returns NULL.
COLLATION_NAMEnvarchar(128)Returns the unique name for the collation if the column is character data or text data type. Otherwise, NULL is returned.
DOMAIN_CATALOGnvarchar(128)If the column is an alias data type, this column is the database name in which the user-defined data type was created. Otherwise, NULL is returned.
DOMAIN_SCHEMAnvarchar(128)If the column is a user-defined data type, this column returns the name of the schema of the user-defined data type. Otherwise, NULL is returned.
DOMAIN_NAMEnvarchar(128)If the column is a user-defined data type, this column is the name of the user-defined data type. Otherwise, NULL is returned.
fuente