Share Pastebin
Guest
Private paste!

Untitled

By: a guest | Apr 17th, 2010 | Syntax: VB.NET | Size: 3.00 KB | Hits: 144 | Expires: Never
Copy text to clipboard
  1. Imports System
  2. Imports System.ComponentModel
  3. Imports System.Collections
  4. Imports System.Diagnostics
  5. Imports System.Data
  6. Imports System.Data.SqlClient
  7. Imports System.Configuration
  8.  
  9. Namespace CodeBuilder.Objects
  10.  
  11.     Public Class Class1
  12.  
  13. #Region " Local Private Properties "
  14.  
  15.         ' connection to data source
  16.         Private con As SqlConnection
  17.         Private _trustedConnection As Boolean = False
  18.         Private _database As String
  19.         Private _username As String
  20.         Private _password As String
  21.         Private _server As String
  22.         Private _connectionString As String = ""
  23.         Private _errorTrap As Boolean = False
  24.         Private _SQLStatement As String
  25.  
  26. #End Region
  27.  
  28. #Region "Class Constructors"
  29.  
  30.         ' <summary>
  31.         ' Default constructor for a database object
  32.         ' </summary>
  33.         Public Sub New()
  34.             MyBase.New()
  35.         End Sub
  36.  
  37. #End Region
  38.  
  39. #Region "Public Properties"
  40.         ' <summary>
  41.         ' Gets/sets the server the to connect to
  42.         ' </summary>
  43.         Public Property server() As String
  44.             Get
  45.                 Return Me._server
  46.             End Get
  47.             Set(ByVal value As String)
  48.                 Me._server = value
  49.             End Set
  50.         End Property
  51.  
  52.         ' <summary>
  53.         ' Gets/sets password to use when connecting to the database
  54.         ' </summary>
  55.         Public Property password() As String
  56.             Get
  57.                 Return Me._password
  58.             End Get
  59.             Set(ByVal value As String)
  60.                 Me._password = value
  61.             End Set
  62.         End Property
  63.  
  64.         ' <summary>
  65.         ' Gets/sets the user name to use when connecting to a server and/or database
  66.         ' </summary>
  67.         Public Property username() As String
  68.             Get
  69.                 Return Me._username
  70.             End Get
  71.             Set(ByVal value As String)
  72.                 Me._username = value
  73.             End Set
  74.         End Property
  75.  
  76.         ' <summary>
  77.         ' Gets/sets database to use when connecting to a server
  78.         ' </summary>
  79.         Public Property database() As String
  80.             Get
  81.                 Return Me._database
  82.             End Get
  83.             Set(ByVal value As String)
  84.                 Me._database = value
  85.             End Set
  86.         End Property
  87.  
  88.         ' <summary>
  89.         ' Get/set wheather the database connection uses NT Authentication
  90.         ' </summary>
  91.         Public Property trustedConnection() As Boolean
  92.             Get
  93.                 Return Me._trustedConnection
  94.             End Get
  95.             Set(ByVal value As Boolean)
  96.                 Me._trustedConnection = value
  97.             End Set
  98.         End Property
  99.  
  100.         Public Property ConnectionString() As String
  101.             Get
  102.                 Return Me._connectionString
  103.             End Get
  104.             Set(ByVal value As String)
  105.                 Me._connectionString = value
  106.             End Set
  107.         End Property
  108.  
  109. #End Region
  110.  
  111.     End Class
  112.  
  113. End Namespace