Login Failed when connected with SQL server with ASP.net

  • Thread starter Thread starter DotNetJunkies User
  • Start date Start date
D

DotNetJunkies User

When i tried to use SQL server 2000 wutg ASP.net

i used the wizard ,everything gone well

i am able to create a connection object at design time and

see the table structure in the datagrid at the design time

but when i view in the browser

it reports that the login failed


the error reported is

Server Error in '/mywebform' Application.
--------------------------------------------------------------------------------

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

Source Error:


Line 37: public void FillDataSet(myDataSet dSet)
Line 38: {
Line 39: sqlDataAdapter1.Fill(dSet);
Line 40: }
Line 41: public Component1()


Please help me in this regard

thanks

Kumar ([email protected])
 
When using the browser, you are running under the anonymous user context
(ie. the ASPNET user). When running via VS.NET in debug mode, you are using
a different user which probably has permissions (or is in a group that has
permissions) to use the SQL database.

You need to either explicitly give permission to the ASPNET user to access
the database and/or setup an "application user" that your app runs under
which has access to the database (perhaps via COM+) or, use impersonation
and ensure the impersonated account can access, or is in a group which has
access to the database.

- Paul Glavich

DotNetJunkies User said:
When i tried to use SQL server 2000 wutg ASP.net

i used the wizard ,everything gone well

i am able to create a connection object at design time and

see the table structure in the datagrid at the design time

but when i view in the browser

it reports that the login failed


the error reported is

Server Error in '/mywebform' Application.
-------------------------------------------------------------------------- ------

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

Source Error:


Line 37: public void FillDataSet(myDataSet dSet)
Line 38: {
Line 39: sqlDataAdapter1.Fill(dSet);
Line 40: }
Line 41: public Component1()


Please help me in this regard

thanks

Kumar ([email protected])
engine supports Post Alerts, Ratings, and Searching.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top