Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Getting the Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'
- Imports API.Database
- Public Class DatabaseHelper
- Private _SqlServer As SQLServer
- Public Sub New()
- End Sub
- Public ReadOnly Property SqlServer() As SQLServer
- Get
- If Me._SqlServer Is Nothing Then
- Me._SqlServer = New API.Database.SQLServer("192.168.1.3", "sa", "xxxxx", "xxxxxx_xxxxxx_xxxxxx")
- End If
- Return Me._SqlServer
- End Get
- End Property
- End Class
- Public Sub New(ByVal server As String, ByVal username As String, ByVal password As String, ByVal database As String)
- If server = "" Then
- server = "(local)"
- //server = "localhost"
- End If
- If username = "" Then
- username = "sa"
- End If
- Dim connectionString As String = String.Format("Data Source={0};Initial Catalog={3};Integrated Security=True;Persist Security Info=False;User ID={1};Password={2};", server, username, password, database)
- //''''''Dim connectionString As String = String.Format("Data Source={0};Initial Catalog={3};User ID={1};Password={2};", server, username, password, database)
- //''Dim connectionString As String = ConfigurationManager.ConnectionStrings("chatterconnectionstring").ConnectionString
- Try
- Me._SQLConnection = New SqlConnection(connectionString)
- Me._SQLConnection.Open()
- Catch ex As Exception
- If True Then
- Throw ex
- End If
- End Try
- End Sub
Add Comment
Please, Sign In to add comment