“/shipindianbo”应用程序中的服务器错误。
--------------------------------------------------------------------------------用户 '1-2\ASPNET' 登录失败。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Exception: 用户 '1-2\ASPNET' 登录失败。源错误: 
行 153: catch(System.Data.SqlClient.SqlException e)
行 154: {
行 155: throw new Exception(e.Message);
行 156: }
行 157: finally
 源文件: C:\Documents and Settings\Owner\桌面\shipindianbo\class\base.cs    行: 155 堆栈跟踪: 
[Exception: 用户 '1-2\ASPNET' 登录失败。]
   My.Vod.DbBase.Base.ExecuteSql4Ds(String strSQL) in C:\Documents and Settings\Owner\桌面\shipindianbo\class\base.cs:155
   My.Video.GetVideoTop10() in c:\documents and settings\owner\桌面\shipindianbo\class\video.cs:124
   shipindianbo.WebForm2.GridBind() in c:\documents and settings\owner\桌面\shipindianbo\left.aspx.cs:40
   shipindianbo.WebForm2.Page_Load(Object sender, EventArgs e) in c:\documents and settings\owner\桌面\shipindianbo\left.aspx.cs:35
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +731 
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573 

解决方案 »

  1.   

    你throw了Exception,但是在调用该方法的时候没有捕捉。也就是说,异常没有处理...
      

  2.   

    解决方法:
    在SQL Enterprise manager ==> 安全性 ==> 登录 ==> 新建登录。
    “常规”选项卡,“名称”填1-2\ASPNET ,其他默认;
    “数据库访问”选项卡,指定访问的数据库,然后赋权限:dbo,public,dbo_owner就OK。 
      

  3.   

    不会是sql的问题吧?我已经设置了数据库的登录是用windows身份验证。
      

  4.   

    行 153: catch(System.Data.SqlClient.SqlException e) 
    行 154: { 
    行 155: throw new Exception(e.Message); 
    行 156: } 
    行 157: finally 
    不要在Catch中重新抛出异常,看看System.Data.SqlClient.SqlException e中抛出的异常是什么,可以写成
    行 153: catch(System.Data.SqlClient.SqlException e) 
    行 154: { 
    行 155:    string error=e.Message;
    行 156: } 
    行 157: finally 
    既然在SqlException中出现了异常,应该是访问数据库有关的问题。