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)
这是提示错误,为什么提示连接SQL2005,可我根本没装SQL2005啊,我是在本地用VS2005+sql2000开发的,服务器上没装VS2005,但装了Framewrok2.0+sql2000,这是为什么啊?
这是提示错误,为什么提示连接SQL2005,可我根本没装SQL2005啊,我是在本地用VS2005+sql2000开发的,服务器上没装VS2005,但装了Framewrok2.0+sql2000,这是为什么啊?
Framewrok2.0是肯定会安装的啊,vs2005的环境就是在Framewrok2.0下的,不过建议你安装sql2005我觉得比2000好用多了哦~
<add name="IaskCaptureConnectionString" connectionString="Data Source=127.0.0.1;Initial Catalog=Capture;User ID=sa;Password=11111"
providerName="System.Data.SqlClient" />
</connectionStrings>
连接字符串
因为你本地有SQLSERVER2005 所以没问题
<add key="IaskCaptureConnectionString" value="server=(local);uid=sa;pwd=11111;database=Capture"/>
</appSettings>
换成这个也不行啊,提示的错误是一样的
SqlConnection MyConnection = new SqlConnection(XXX);
XXX的内容填写为
双击数据库,将数据库属性中connection string属性中的字符串替代 XXX
然后将上面的每个/前再加一个/。然后注意把该删除的“删除就好了
例如:
SqlConnection MyConnection = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Documents and Settings\\comiscience\\My Documents\\Visual Studio 2005\\Projects\\websiteTests\\WebSite4\\App_Data\\Database.mdf;Integrated Security=True;User Instance=True");