急,100分求救,解答完马上结帖~~~~

zjkxlf 2005-06-01 05:55:24
错误显示:
Server Error in '/myoa/Webs' Application.
--------------------------------------------------------------------------------

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 37: myCommand.Parameters.Add(parameterReason);
Line 38:
Line 39: myConnection.Open();
Line 40: myCommand.ExecuteNonQuery();
Line 41: myConnection.Close();


Source File: C:\Inetpub\wwwroot\myoa\DA\EmpDB.cs Line: 39

Stack Trace:


[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +472
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
myoa.DA.EmpDB.Login(String loginid, String password) in C:\Inetpub\wwwroot\myoa\DA\EmpDB.cs:39
Webs.login1.ok_Click(Object sender, ImageClickEventArgs e) in c:\inetpub\wwwroot\myoa\Webs\login.aspx.cs:68
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +109
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +69
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277

我用的系统是windows sp2


...全文
78 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
老戴12345654 2005-06-01
  • 打赏
  • 举报
回复
<appSettings>
<add key="ConnectionString" value="server=(local);database=myoa;User ID=sa;password="/>
</appSettings>
morality 2005-06-01
  • 打赏
  • 举报
回复
数据库连接字符串大全,请参见:

http://www.connectionstrings.com/
zjkxlf 2005-06-01
  • 打赏
  • 举报
回复
<appSettings>
<add key="ConnectionString" value="server=localhost;database=myoa;User ID=sa;password="/>
</appSettings>
我是这样写的!!!
hchxxzx 2005-06-01
  • 打赏
  • 举报
回复
如果是本机数据库,不能写localhost要写(local)
owenbeckham 2005-06-01
  • 打赏
  • 举报
回复
连接字符串不对吧
wlzbaby 2005-06-01
  • 打赏
  • 举报
回复
SQL Server 访问被拒绝
wssmax 2005-06-01
  • 打赏
  • 举报
回复
好像是连接字符串不对
fanruinet 2005-06-01
  • 打赏
  • 举报
回复
是windows 2003的话就要把给Network Service访问SQL的权限
fengfangfang 2005-06-01
  • 打赏
  • 举报
回复
如果是使用SSPI方式连接数据库,则
在SQL Server中,把aspnet用户添加上,没设置其权限
fanruinet 2005-06-01
  • 打赏
  • 举报
回复
连接字符串是什么?

用的是Sql身份验证么?

62,041

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧