Can't open Northwind

Discussion in 'ASP .Net' started by =?Utf-8?B?ZGVubmlzdDY4NQ==?=, Dec 8, 2005.

  1. Can't open Northwind


    I remembered doing walkthrough using Northwind. However it wasn't an http
    project but a file project using the development server. Northwind allowed
    me to add, edit and insert, and the web page looked fine.

    I opened a simple project just to see whether I could get my sqlserver on
    the internet. (vs studio 2005, sqlserver 2005)

    I created the project in http location http://localhost/Northwind . I
    dragged a sqldatasource to the page, configuring it to display ID and
    ProductName. I clicked advanced, but noticed the generate insert, edit and
    delete were grayed out. That told me something was wrong with my
    authetification.

    I configured my sqlserver 2005 to have integrated security.

    I built the solution and website, then pressed cntl-F5. I got a login
    error. Nowhere did the page ask me for username and password. First
    questions - how do I get this to open up a web page, and how to I get it to
    allow me to generate insert, edit and delete statements?

    dennist685

    Server Error in '/Northwind' Application
    --------------------------------------------------------------------------------

    Cannot open database "Northwind" requested by the login. The login failed.
    Login failed for user 'YOUR-02910F1DF1\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: Cannot open database
    "Northwind" requested by the login. The login failed.
    Login failed for user 'YOUR-02910F1DF1\ASPNET'.

    Source Error:

    An unhandled exception was generated during the execution of the current web
    request. Information regarding the origin and location of the exception can
    be identified using the exception stack trace below.

    Stack Trace:


    [SqlException (0x80131904): Cannot open database "Northwind" requested by
    the login. The login failed.
    Login failed for user 'YOUR-02910F1DF1\ASPNET'.]
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    exception, Boolean breakConnection) +735123

    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj) +188
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
    cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
    bulkCopyHandler, TdsParserStateObject stateObj) +1838
    System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean
    enlistOK) +33

    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
    owningObject, SqlConnectionString connectionOptions, String newPassword,
    Boolean redirectedUserInstance) +628

    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    identity, SqlConnectionString connectionOptions, Object providerInfo, String
    newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170

    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
    owningConnection) +359

    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
    owningObject) +424
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
    owningObject) +66
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
    owningObject) +496
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
    owningConnection) +82
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
    outerConnection, DbConnectionFactory connectionFactory) +105
    System.Data.SqlClient.SqlConnection.Open() +111
    System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
    DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable,
    IDbCommand command, CommandBehavior behavior) +121
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
    Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
    behavior) +137
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83

    System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770
    System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments,
    DataSourceViewSelectCallback callback) +17
    System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
    System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
    System.Web.UI.WebControls.DetailsView.DataBind() +4
    System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
    System.Web.UI.WebControls.DetailsView.EnsureDataBound() +181
    System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
    +69
    System.Web.UI.Control.EnsureChildControls() +87
    System.Web.UI.Control.PreRenderRecursiveInternal() +41
    System.Web.UI.Control.PreRenderRecursiveInternal() +161
    System.Web.UI.Control.PreRenderRecursiveInternal() +161
    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
     
    =?Utf-8?B?ZGVubmlzdDY4NQ==?=, Dec 8, 2005
    #1
    1. Advertising

  2. Check the connection by going through the properties page. By default, the
    wizard drops the password portion (for security reasons). I find it easier
    to dink with the actual code, but, if I remember correctly, the wizard gives
    you this option, as well.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    ***********************************************
    Think Outside the Box!
    ***********************************************
    "dennist685" <> wrote in message
    news:...
    > Can't open Northwind
    >
    >
    > I remembered doing walkthrough using Northwind. However it wasn't an http
    > project but a file project using the development server. Northwind
    > allowed
    > me to add, edit and insert, and the web page looked fine.
    >
    > I opened a simple project just to see whether I could get my sqlserver on
    > the internet. (vs studio 2005, sqlserver 2005)
    >
    > I created the project in http location http://localhost/Northwind . I
    > dragged a sqldatasource to the page, configuring it to display ID and
    > ProductName. I clicked advanced, but noticed the generate insert, edit
    > and
    > delete were grayed out. That told me something was wrong with my
    > authetification.
    >
    > I configured my sqlserver 2005 to have integrated security.
    >
    > I built the solution and website, then pressed cntl-F5. I got a login
    > error. Nowhere did the page ask me for username and password. First
    > questions - how do I get this to open up a web page, and how to I get it
    > to
    > allow me to generate insert, edit and delete statements?
    >
    > dennist685
    >
    > Server Error in '/Northwind' Application.
    > --------------------------------------------------------------------------------
    >
    > Cannot open database "Northwind" requested by the login. The login failed.
    > Login failed for user 'YOUR-02910F1DF1\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: Cannot open
    > database
    > "Northwind" requested by the login. The login failed.
    > Login failed for user 'YOUR-02910F1DF1\ASPNET'.
    >
    > Source Error:
    >
    > An unhandled exception was generated during the execution of the current
    > web
    > request. Information regarding the origin and location of the exception
    > can
    > be identified using the exception stack trace below.
    >
    > Stack Trace:
    >
    >
    > [SqlException (0x80131904): Cannot open database "Northwind" requested by
    > the login. The login failed.
    > Login failed for user 'YOUR-02910F1DF1\ASPNET'.]
    > System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    > exception, Boolean breakConnection) +735123
    >
    > System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    > stateObj) +188
    > System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
    > cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
    > bulkCopyHandler, TdsParserStateObject stateObj) +1838
    > System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean
    > enlistOK) +33
    >
    > System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
    > owningObject, SqlConnectionString connectionOptions, String newPassword,
    > Boolean redirectedUserInstance) +628
    >
    > System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    > identity, SqlConnectionString connectionOptions, Object providerInfo,
    > String
    > newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
    > +170
    >
    > System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    > options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
    > owningConnection) +359
    >
    > System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
    > owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
    > System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
    > owningObject) +424
    > System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
    > owningObject) +66
    > System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
    > owningObject) +496
    > System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
    > owningConnection) +82
    > System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
    > outerConnection, DbConnectionFactory connectionFactory) +105
    > System.Data.SqlClient.SqlConnection.Open() +111
    > System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
    > DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
    > srcTable,
    > IDbCommand command, CommandBehavior behavior) +121
    > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
    > startRecord,
    > Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
    > behavior) +137
    > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
    > +83
    >
    > System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments
    > arguments) +1770
    > System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments,
    > DataSourceViewSelectCallback callback) +17
    > System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
    > System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
    > System.Web.UI.WebControls.DetailsView.DataBind() +4
    > System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
    > System.Web.UI.WebControls.DetailsView.EnsureDataBound() +181
    >
    > System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
    > +69
    > System.Web.UI.Control.EnsureChildControls() +87
    > System.Web.UI.Control.PreRenderRecursiveInternal() +41
    > System.Web.UI.Control.PreRenderRecursiveInternal() +161
    > System.Web.UI.Control.PreRenderRecursiveInternal() +161
    > System.Web.UI.Page.ProcessRequestMain(Boolean
    > includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
    >
    >
    >
     
    Cowboy \(Gregory A. Beamer\), Dec 8, 2005
    #2
    1. Advertising

  3. Thanks Gregory,

    I tried the solution property page and the http property pages. Neither of
    them allowed me to access the connection string. I played around with the
    sqldatasource configuration. But the choice was using windows
    authentification by default - my previous choice, or sqlserver configuration.
    When I tried the later, I used my name dennist685 with no password. But the
    test connection failed.

    So I'm still in the same place.

    dennist685
     
    =?Utf-8?B?ZGVubmlzdDY4NQ==?=, Dec 9, 2005
    #3
  4. =?Utf-8?B?ZGVubmlzdDY4NQ==?=

    green apple

    Joined:
    Jun 26, 2009
    Messages:
    1
    Cannot open database "Northwind" requested by the login. The login failed. > Login fa

    Hi,

    I also encountered this kind of problem
    I want to share how I overcome this problem
    here are the steps i follow after that I can fix that problem
    1. open MS SQL Server Management Studio
    2. expand the dbase you want to access (eg. Northwind)
    3. expand security folder
    4. right click on User, click new user
    5. enter ASPNET into User name text box
    6. enter YOUR-02910F1DF1\ASPNET in Login name
    7. select db_datareader checkbox and db_datawriter checkbox under
    Database role membership
    8. Click Ok
    9. Restart your SQL Server
    10. Test your website again
    I got this solution from here :flute:
    imar.spaanjaars.com/QuickDocId.aspx?quickdoc=395
     
    green apple, Jun 26, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bright
    Replies:
    2
    Views:
    4,021
    Bright
    Jul 16, 2005
  2. Bright
    Replies:
    1
    Views:
    544
  3. Chris Moore

    RE: Northwind based ASP.NET Demo

    Chris Moore, Apr 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    526
    Chris Moore
    Apr 17, 2004
  4. =?Utf-8?B?UGV0ZXI=?=

    <%$ConnectionStrings:Northwind%>

    =?Utf-8?B?UGV0ZXI=?=, May 16, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    443
    Brock Allen
    May 16, 2006
  5. Tony Johansson

    How can ASPNET access the Northwind database

    Tony Johansson, Jan 7, 2010, in forum: ASP .Net
    Replies:
    1
    Views:
    1,285
    Alvin Bruney - ASP.NET MVP
    Jan 11, 2010
Loading...

Share This Page