Results 1 to 3 of 3

Thread: ASP.NET problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2008
    Posts
    87

    ASP.NET problem

    i want to display data on a web page
    i m using sql server 2000 and northwind database
    but when i run my project then error comes on web page and data doesn't displayed.
    This error comes on web page
    Server Error in '/WebApplication2' Application.


    Login failed for user 'PC1\ASPNET'.
    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: Login failed for user 'PC1\ASPNET'.

    Source Error:


    Line 95:
    Line 96: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Line 97: SqlDataAdapter1.Fill(DataSet11)
    Line 98: DataGrid1.DataBind()
    Line 99:


    Source File: c:\inetpub\wwwroot\WebApplication2\WebForm1.aspx.vb Line: 97

    i m using following code only
    Code:
     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            SqlDataAdapter1.Fill(DataSet11)
            DataGrid1.DataBind()
    
        End Sub
    plz see the attache file
    can any body tell me what is the problem.
    Attached Files Attached Files

  2. #2
    Fanatic Member
    Join Date
    Feb 2006
    Posts
    592

    Re: ASP.NET problem

    in the Server explorer right-click the database you work with and select "close connection" then run the app again. At least it is the way i am fixing this odd error. If anyone knows a better way it would be nice to share the solution with us.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: ASP.NET problem

    You're attempting to connect to your SQL Server with Integrated Security. That means it will connect as the user under which the web application is running. By default, this is ASPNET, and by default, the ASPNET worker process has very little permission to do anything. You need to modify your connection string to use a proper SQL Server user. If you don't have one yet, then login to your SQL Server Management IDE and create a user, give the user permissions on the database you want to connect to and then specify that username and password in your connectionstring.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width