SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.Source Error:
Line 33:
Line 34: If Con.State = ConnectionState.Open Then Con.Close()
Line 35: Con.Open() '错误发生行
Line 36: ' Response.End()
Line 37: Dim cmd As New SqlCommand("select [name] from supp ", Con)
Source File: C:\Inetpub\wwwroot\test\Suppliers.aspx.vb Line: 35 Stack Trace:
[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +484
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
test.Suppliers.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\test\Suppliers.aspx.vb:35
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731 什么意思,该怎么解决?
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.Source Error:
Line 33:
Line 34: If Con.State = ConnectionState.Open Then Con.Close()
Line 35: Con.Open() '错误发生行
Line 36: ' Response.End()
Line 37: Dim cmd As New SqlCommand("select [name] from supp ", Con)
Source File: C:\Inetpub\wwwroot\test\Suppliers.aspx.vb Line: 35 Stack Trace:
[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +484
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
test.Suppliers.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\test\Suppliers.aspx.vb:35
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731 什么意思,该怎么解决?
解决方案 »
- sql语句困扰我半天了,高手帮帮忙
- asp.net 如何将web用户控件生成dll
- 关于一个网站的performance test
- 谁能帮我写一个这样的才存储过程啊?
- 谁有.net 2.0的电子教程(C#)
- 在Select记录时,如何按 Where ID in(3,8,4,1) 的形式排序?
- Rich ContentRotator 控件的注册码,100分求!!
- 服务器程序集加载问题!急求!
- 如何动态设置document的backgroud
- 发布:使用SqlConnection和SqlTransaction的心得。一个类,一个例子。
- 请问TreeView怎么用呢?
- .NET验证控件是在客户端验证还是在服务器端验证?
我要跳楼 !!
,强烈建议采用dataadapter提取datatable这种方式,我的站点到现在都没出现过你上面的错误,之前我的设计思路跟你的很相像,你看着办吧
server=YourServerName;database=yourdatabasename;uid=username;pwd=password;同时请检查试图打开连接的用户是否有相应的权限。
这句话 你判断的太武断了 假如 con处于其他状态 你如何 让他con.open呢
2、你的机器再装一下sql客户端试试。
已经明确的告诉你错误在哪儿:Sqlserver不存在或拒绝访问。
你并没有把你发生错误的核心代码帖出来。你应该把连接语句给帖出来。
你现在代码中也有些问题,
“If Con.State = ConnectionState.Open Then Con.Close()”
这个可以不要,你记得每次打开之后关闭就行了。还有一点,你得看看你的SqlServer有没有启动,或者是SqlServer有没有正确的安装,有没有错误。