use ADO.NET Or other ORM framework, throw this exception, it may be the wrong database to connect. Maybe the database that the program wants to connect to is database1, and your configuration file or connection string is copied. If you neglect to modify it completely, this exception will appear.
Exception specific information
NHibernate.Exceptions.GenericADOException : could not execute query
[ select userinfo0_.id as id0_, userinfo0_.name as name2_0_, userinfo0_.description as descript3_0_, userinfo0_.state as state4_0_ from UserInfo userinfo0_ where userinfo0_.name ='testname' ]
[SQL: select userinfo0_.id as id0_, userinfo0_.name as name2_0_, userinfo0_.description as descript3_0_, userinfo0_.state as state4_0_ from UserInfo userinfo0_ where userinfo0_.name ='testname']
----> System.Data.SqlClient.SqlException : Invalid object name 'UserInfo'.
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters)
at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes)
at NHibernate.Hql.Ast.ANTLR.Loader.QueryLoader.List(ISessionImplementor session, QueryParameters queryParameters)
at NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.List(ISessionImplementor session, QueryParameters queryParameters)
at NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters queryParameters, ISessionImplementor session, IList results)
at NHibernate.Impl.SessionImpl.List(String query, QueryParameters queryParameters, IList results)
at NHibernate.Impl.SessionImpl.List[T](String query, QueryParameters parameters)
at NHibernate.Impl.QueryImpl.List[T]()
UserInfoDAL.cs(21,0): at NHibernateWCF.DAL.UserInfoDAL.ExistUserInfo(String name)
UserInfoDALTest.cs(18,0): at NHibernateWCF.Test.UserInfoDALTest.ExistUserInfoTest()
--SqlException
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
This is the stack information in the case of NHibernate when the connection database is inconsistent. use ADO.NET Or other frameworks may be different in details, but they should all be exceptions of this kind in general.
The solution is to modify the connection string, change the database connected in the configuration to the correct database, so that the corresponding table can be found when executing SQL statements.
Read More:
- com.microsoft.sqlserver . jdbc.SQLServerException : invalid object name ‘XX’
- Error domain = nsurlerrordomain code = – 1001 “request timeout occurred in swift alamofire get request. ” UserInfo={NSUnderlyingErro
- Error: invalid permission for adding an object to repository database
- How to Use the object of ES6 to clear the object value
- Ubuntu: Failed to initialize compiler: object java.lang.Object In compiler mirror not found
- The background object of thymeleaf is null, which solves the problem of error when the object is empty to get the property value
- The JSON object is converted into a formdata object, and the formdata object is converted into a JSON object
- TypeError: ‘numpy.int64′ object is not iterable ,’int’ object is not iterable
- Object is JSON, and JSON is converted to object
- SQL error: 17006, sqlstate: 99999 invalid column name
- ORA-12545: Connect failed because target host or object does not exist
- Attributeerror: object has no attribute
- TypeError: object of type ‘Cursor‘ has no len()
- Server object error ‘ASP 0178: 80070005’
- JavaScript summary: the difference between typeof and instanceof, and Object.prototype.toString() method
- Property or field ‘Title‘ cannot be found on object of type
- [Err] ERROR: invalid input syntax for integer: “1.0”
- Call to a member function fetch_assoc() on a non-object
- Invalid username / password; login denied