vb.net连接sql server 2005的有关问题

vb.net连接sql server 2005的问题
望各位帮忙解决下问题,我先是安装了vs2008里面自带了sqlserver2005然后我去官网下载了SQLServer2005_SSMSEE.msi的管理工具,本来以为是正常了,就去测试了一下vb.net连接2005
测试代码:
Imports System.Data.SqlClient

Module Module1
  Sub Main()
  Dim strConn As String = "server=localhost;DataBase=huang;Integrated Security=SSPI"
  Dim conn As SqlConnection = New SqlConnection(strConn)
  conn.Open()
  Console.WriteLine("成功连接!")
  conn.Close()
  Console.WriteLine("关闭连接!")
  Console.ReadLine()
  End Sub
End Module
就是简单的书上的东西,我的数据库名就是huang
可就是连不进去啊在conn.Open()这里就过不去了
错误代码:未处理 System.Data.SqlClient.SqlException
  Class=20
  ErrorCode=-2146232060
  LineNumber=0
  Message="在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)"
  Number=2
  Server=""
  Source=".Net SqlClient Data Provider"
  State=0
  StackTrace:
  在 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) 在 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) 在 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) 在 System.Data.SqlClient.SqlConnection.Open() 在 WindowsApplication1.Module1.Main() 位置 C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\WindowsApplication1\Module1.vb:行号 7 在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) 在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 在 System.Threading.ThreadHelper.ThreadStart_Context(Object state) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

本人弄了好久了,以为是VS2008没装好,还重装了,帮帮忙吧,谢谢了...

------解决方案--------------------
检查执行程序的用户是否具有权限。
对于asp程序,需要检查IIS对应的用户。

SQL Server 是不是配置了集成安全性。
------解决方案--------------------
sql express的默认实例是sqlexpress吧。
"server=localhost\sqlexpress;DataBase=huang;Integrated Security=SSPI"

还有你使用Integrated Security,需要network server(win2003)或者ASPNET(XP)有权限读写数据库

或者你不要使用集成验证,而是用sql server的验证,需要在sql server中创建用户。
使用这种方式
Data Source=PGO_SWsvr;Initial Catalog=PES_DEV;User ID=sa;Password=sa //账号和密码都是sa

------解决方案--------------------
Provider=SQLOLEDB;Database=数据库名称;Server=.;Integrated Security=SSPI;Persist Security Info=False
------解决方案--------------------
我是OLE的
------解决方案--------------------
看看services.msc里面的服务有没有打开,
跟据你描述有两种情况, 你可以检查一下
1, SQL服务进程没有打开
2,sqlconnection 连接对像没有写准备
------解决方案--------------------
服务没打开
------解决方案--------------------
SQL Server不允许进行远程连接的解决办法

http://www.999net.com/network/Mssql/200901/32149.html
------解决方案--------------------
参考:


http://topic.csdn.net/u/20090621/08/40e0864c-5ae7-4c14-94e6-431353b8d724.html