繁体   English   中英

用户'NT AUTHORITY \\ ANONYMOUS LOGON'登录失败

[英]Getting the Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

我只是设置我的旧电脑来运行SQL Server和VisualSVN。 我有一台笔记本电脑和另一台我需要在网站上工作的电脑,这就是为什么我在一台单独的电脑上设置subversion和sql server。 我已经设置了VisualSVN和ToirtoiseSVN,但是我在下面的SQL Server问题是如何连接到数据库:

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

我已经阅读了一些文章,发现因为我在另一个位置运行SQL Server而我的Web项目在另一个位置的IIS上这就是为什么我得到权限问题,但我该如何解决这个问题?

我正在使用SQL Server 2008 Express R2和Visual Studio 2008。

尝试在连接字符串中设置Integrated Security = false

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM