How will I correct the error generated???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Denzio

    How will I correct the error generated???

    I am a beginner in web developtment in asp.net using visual basic.net. i was trying to access data in SQL 2000 and display it in a datagrid/listbox, but I kept on getting the same message from the browser :
    Server Error in '/Sample2' Application.
    --------------------------------------------------------------------------------

    Login failed for user '7117FHGZ0411\A SPNET'.
    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.Sql Client.SqlExcep tion: Login failed for user '7117FHGZ0411\A SPNET'.

    Source Error:


    Line 111: ("SELECT Lname FROM Employess", SqlConnection1)
    Line 112: Dim drCities As SqlDataReader
    Line 113: SqlConnection1. Open()
    Line 114: drCities = cmdCities.Execu teReader()
    Line 115: lstcities.DataS ource = drCities




  • Martin Marinov

    #2
    Re: How will I correct the error generated???

    YOu have to grant access to the ASPNET user to your database
    open you Enterprise Manager
    Open your database and click on Users
    right click in the right and select New Database User
    in the login name select <new> and from the ... button select
    7117FHGZ0411\AS PNET
    set it to be with windwos authentication, select your database

    in your connection string for the database connection you have to set
    Integrated Security=True and not set a user name and password so the .net
    framework will use the aspnet account as a user in wich context the asp.net
    process is running under to connect to the database

    Regards
    Martin

    "Denzio" <Denzio@discuss ions.microsoft. com> wrote in message
    news:951F5E4F-5D90-4081-8D0D-6703921441CE@mi crosoft.com...[color=blue]
    > I am a beginner in web developtment in asp.net using visual basic.net. i[/color]
    was trying to access data in SQL 2000 and display it in a datagrid/listbox,
    but I kept on getting the same message from the browser :[color=blue]
    > Server Error in '/Sample2' Application.
    > --------------------------------------------------------------------------[/color]
    ------[color=blue]
    >
    > Login failed for user '7117FHGZ0411\A SPNET'.
    > Description: An unhandled exception occurred during the execution of the[/color]
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.[color=blue]
    >
    > Exception Details: System.Data.Sql Client.SqlExcep tion: Login failed for[/color]
    user '7117FHGZ0411\A SPNET'.[color=blue]
    >
    > Source Error:
    >
    >
    > Line 111: ("SELECT Lname FROM Employess", SqlConnection1)
    > Line 112: Dim drCities As SqlDataReader
    > Line 113: SqlConnection1. Open()
    > Line 114: drCities = cmdCities.Execu teReader()
    > Line 115: lstcities.DataS ource = drCities
    >
    >
    >
    >[/color]


    Comment

    Working...