none
SqlException (0x80131904): Invalid object name 'dbo.SystemUser'.

    Question

  • I am attempting to connect a 3rd party database to my IIS through SQL 2005.  However, I keep getting this error when trying to access the DB through IE.  SQL is set to Window Authentication and there is no table anywhere called "SystemUser."


    Invalid object name 'dbo.SystemUser'.

    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: Invalid object name 'dbo.SystemUser'.

    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): Invalid object name 'dbo.SystemUser'.]
       System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
       System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33
       System.Data.SqlClient.SqlDataReader.get_MetaData() +83
       System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
       System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
       System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
       System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
       System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +12
       NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd) +35
       NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session) +239
       NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +203
       NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +70
       NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) +154
    
    [ADOException: could not execute query
    [ SELECT this_.Id as Id12_0_, this_.UserId as UserId12_0_, this_.LastLogin as LastLogin12_0_, this_.Password as Password12_0_, this_.PasswordQuestion as Password5_12_0_, this_.PasswordAnswer as Password6_12_0_, this_.isApproved as isApproved12_0_, this_.isLockedOut as isLocked8_12_0_, this_.CreateDate as CreateDate12_0_, this_.Comment as Comment12_0_, this_.LastLockoutDate as LastLoc11_12_0_, this_.LastPasswordChangeDate as LastPas12_12_0_, this_.FailedPasswordAttemptCount as FailedP13_12_0_, this_.FailedPasswordAnswerAttemptCount as FailedP14_12_0_, this_.person as person12_0_ FROM dbo.SystemUser this_ WHERE this_.UserId = ? ]
    Positional parameters:  #0>
    [SQL: SELECT this_.Id as Id12_0_, this_.UserId as UserId12_0_, this_.LastLogin as LastLogin12_0_, this_.Password as Password12_0_, this_.PasswordQuestion as Password5_12_0_, this_.PasswordAnswer as Password6_12_0_, this_.isApproved as isApproved12_0_, this_.isLockedOut as isLocked8_12_0_, this_.CreateDate as CreateDate12_0_, this_.Comment as Comment12_0_, this_.LastLockoutDate as LastLoc11_12_0_, this_.LastPasswordChangeDate as LastPas12_12_0_, this_.FailedPasswordAttemptCount as FailedP13_12_0_, this_.FailedPasswordAnswerAttemptCount as FailedP14_12_0_, this_.person as person12_0_ FROM dbo.SystemUser this_ WHERE this_.UserId = ?]]
       NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) +248
       NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) +18
       NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes) +81
       NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results) +334
       NHibernate.Impl.CriteriaImpl.List(IList results) +41
       NHibernate.Impl.CriteriaImpl.List() +35
       NHibernate.Impl.CriteriaImpl.UniqueResult() +8
       DBAccess.UserDAO.getByUserName(String& userName) in C:\UCBWork\project_branches\drdp_1_4_0\drdp.net\DBAccess\dao\UserDAO.vb:19
       DBAccess.BearMembershipProvider.GetUser(String username, Boolean userIsOnline) in C:\UCBWork\project_branches\drdp_1_4_0\drdp.net\DBAccess\providers\BearMembershipProvider.vb:435
       System.Web.Security.Membership.GetUser(String username, Boolean userIsOnline) +82
       System.Web.Security.Membership.GetUser() +19
       drdpWeb.SessionUtil.GetCurrentUser(HttpSessionState session, ISession _session) in C:\UCBWork\project_branches\drdp_1_4_0\drdp.net\drdpWeb\SessionUtil.vb:713
       drdptech.DBAccessPage.OnInit(EventArgs e) in C:\UCBWork\project_branches\drdp_1_4_0\drdp.net\drdptech\Code\DBAccessPage.vb:252
       System.Web.UI.Control.InitRecursive(Control namingContainer) +333
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378
    


    • Edited by YWKarri Thursday, November 03, 2011 10:08 PM
    Thursday, November 03, 2011 9:53 PM

Answers

  • Hello,

    It seems that it is a problem from NHibernate which is unable to format the query in a correct way.

    I would suggest you to have a look at this line :

    DBAccess.UserDAO.getByUserName(String& userName) in C:\UCBWork\project_branches\drdp_1_4_0\drdp.net\DBAccess\dao\UserDAO.vb:19

    Try to see whether there is a code problem in the file of which the name is appearing in this error line.

    I am curious : please, could you explain why you are using DAO or why you are using code needing DAO ? I used it a long time ago when i was using the version 5 or 6 of VB/VC++ ( 15 years ago maybe ). I was thinking that DAO is no longer supported by Microsoft.

    Morever, NHibernate, why not but wich version ?

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.
    • Marked as answer by Stephanie Lv Friday, November 11, 2011 5:11 AM
    Friday, November 04, 2011 8:22 AM

All replies

  • Verify the connection string, and make sure you are connecting to right database.

    Also, check if you have permissions to SELECT on this object.


    - Vishal

    SqlAndMe.com

    Friday, November 04, 2011 4:02 AM
  • Hello,

    It seems that it is a problem from NHibernate which is unable to format the query in a correct way.

    I would suggest you to have a look at this line :

    DBAccess.UserDAO.getByUserName(String& userName) in C:\UCBWork\project_branches\drdp_1_4_0\drdp.net\DBAccess\dao\UserDAO.vb:19

    Try to see whether there is a code problem in the file of which the name is appearing in this error line.

    I am curious : please, could you explain why you are using DAO or why you are using code needing DAO ? I used it a long time ago when i was using the version 5 or 6 of VB/VC++ ( 15 years ago maybe ). I was thinking that DAO is no longer supported by Microsoft.

    Morever, NHibernate, why not but wich version ?

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.
    • Marked as answer by Stephanie Lv Friday, November 11, 2011 5:11 AM
    Friday, November 04, 2011 8:22 AM