(SQL) SQL (2014)

New SQL Server project templates for VS2015 (VBSqlUserDefinedType.vb)

   1:  Imports System
   2:  Imports System.Data
   3:  Imports System.Data.SqlClient
   4:  Imports System.Data.SqlTypes
   5:  Imports Microsoft.SqlServer.Server
   6:   
   7:  <Serializable()> _
   8:  <Microsoft.SqlServer.Server.SqlUserDefinedType(Format.Native)> _
   9:  Public Structure $safeitemname$
  10:      Implements INullable
  11:   
  12:      Public Overrides Function ToString() As String
  13:          ' $PutYourCodeHereComment$
  14:          Return ""
  15:      End Function
  16:   
  17:      Public ReadOnly Property IsNull() As Boolean Implements INullable.IsNull
  18:          Get
  19:              ' $PutYourCodeHereComment$
  20:              Return m_Null
  21:          End Get
  22:      End Property
  23:   
  24:      Public Shared ReadOnly Property Null As $safeitemname$
  25:          Get
  26:              Dim h As $safeitemname$ = New $safeitemname$
  27:              h.m_Null = True
  28:              Return h
  29:          End Get
  30:      End Property
  31:   
  32:      Public Shared Function Parse(ByVal s As SqlString) As $safeitemname$
  33:          If s.IsNull Then
  34:              Return Null
  35:          End If
  36:   
  37:          Dim u As $safeitemname$ = New $safeitemname$
  38:          ' $PutYourCodeHereComment$
  39:          Return u
  40:      End Function
  41:   
  42:      ' $PlaceholderMethodComment$
  43:      Public Function Method1() As String
  44:          ' $PutYourCodeHereComment$
  45:          Return String.Empty
  46:      End Function
  47:   
  48:      ' $PlaceholderStaticMethodComment$
  49:      Public Shared Function Method2() As SqlString
  50:          ' $PutYourCodeHereComment$
  51:          Return New SqlString("")
  52:      End Function
  53:   
  54:      ' $PlaceholderFieldComment$
  55:      Public m_var1 As Integer
  56:   
  57:      ' $PrivateMemberComment$
  58:      Private m_Null As Boolean
  59:  End Structure


Comments ( )
Link to this page: //www.vb-net.com/VS2015-SQL-Server-Project-Templates/VBSqlUserDefinedType-vb.htm
< THANKS ME>