hello ,
i am working with NhiberNate and VB.NET
i am getting "could not execute Query" error in my applicaion.
my code is as follows.
Public Function GetTicketStatus(ByVal tkt As String) As String
Try
Dim strQuery As String = "Select stat from tkt where tkt = '" & tkt & "'"
Dim resultData = GetISession.CreateSQLQuery(strQuery).List()
If resultData IsNot Nothing AndAlso resultData.Count > 0 Then
Return resultData(0).ToString()
Else
Return String.Empty
End If
Catch ex As Exception
End Try
End Function
The stack Trace is as follows
Message: could not execute query
[ Select stat from tkt where tkt = = '12345' ] [SQL: Select stat from tkt where tkt = = '12345']
Stack Trace :
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) in E:\sources\NHibernate\src\NHibernate\Loader\Loader.cs:line 1660
at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) in E:\sources\NHibernate\src\NHibernate\Loader\Loader.cs:line 1575
at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes) in E:\sources\NHibernate\src\NHibernate\Loader\Loader.cs:line 1569
at NHibernate.Loader.Custom.CustomLoader.List(ISessionImplementor session, QueryParameters queryParameters) in E:\sources\NHibernate\src\NHibernate\Loader\Custom\CustomLoader.cs:line 272
at NHibernate.Impl.SessionImpl.ListCustomQuery(ICustomQuery customQuery, QueryParameters queryParameters, IList results) in E:\sources\NHibernate\src\NHibernate\Impl\SessionImpl.cs:line 2107
at NHibernate.Impl.SessionImpl.List(NativeSQLQuerySpecification spec, QueryParameters queryParameters, IList results) in E:\sources\NHibernate\src\NHibernate\Impl\SessionImpl.cs:line 2090
at NHibernate.Impl.SessionImpl.List(NativeSQLQuerySpecification spec, QueryParameters queryParameters) in E:\sources\NHibernate\src\NHibernate\Impl\SessionImpl.cs:line 2066
at NHibernate.Impl.SqlQueryImpl.List() in E:\sources\NHibernate\src\NHibernate\Impl\SqlQueryImpl.cs:line 127
at BusinessClasses.TicketHeaderBll.GetTicketStatus(String tkt) in J:\BusinessClasses\TicketHeaderBll.vb:line 4803
Inner Exception : - Object reference not set to an instance of an object.
in inner exception it is "Object reference not set to an instance of an object" .
with my database and in my machine it is correctly working.but in rare situations this is coming.
any one can explain please how to resolve it.