ASP.NET與SQL Server 2005 連接

資料庫∶Student.mdf User ID∶SA Password∶12345 連接程式碼∶ Dim ConnString As String ConnString = "Data Source=None;" & _ "User ID=SA;Password=12345;" & _ "Initial Catalog=Student" MyCon=New SqlConnection(connstring) Mycon.Open() 結果與資料庫的連接設定出現問題, An error has occurred... show more 資料庫∶Student.mdf
User ID∶SA
Password∶12345

連接程式碼∶

Dim ConnString As String
ConnString = "Data Source=None;" & _
"User ID=SA;Password=12345;" & _
"Initial Catalog=Student"
MyCon=New SqlConnection(connstring)
Mycon.Open()

結果與資料庫的連接設定出現問題,

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

請問要如何更正SQL Server連接設定? (拜托,詳細些)
Update: 首先非常感謝 網頁程式設計 的解答,
相關資訊:
Full computer name: Snoopy(不是之前寫的"none")
Windows User Account(For login window): Alien Workshop
Database: Student.mdb
SQL SERVER 2005 EXPRESS 安裝時設置:
User ID: SA(預設),Password:12345
Update 2: 我做了以下修改,
在Control Panel的ODBC Data Source設置一個新的System DNS, 以SQL Server做為Driver連接去SQL Server: SNOOPY\SQLEXPRESS
選擇With Window NT Authentication Using the network login ID
然後default database to: Student.mdb 然後 Finish
Update 3: ConnString = "Data Source=snoopy\sqlexpress;User ID=SA;Password=12345;Initial Catalog=Student"
結果還是失敗Login failed for user 'SA'. The user is not associated with a trusted SQL Server connection.
Update 4: 如果修改為您建議的ConnString" 則結果是Cannot open database "TestDB" requested by the login. The login failed. Login failed for user 'sa'.
3 answers 3