开发者

nhibernate Antlr.Runtime.NoViableAltException

return NHibernateSession.CreateQuery(@"TRUNCATE TABLE dbo.Exceptions").ExecuteUpdate();

Exception of type 'Antlr.Runtime.NoViableAltException' was thrown. [TRUNCATE TABLE Exceptions] 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: NHibernate.Hql.Ast.ANTLR.QuerySyntaxException: Exception of type 'Antlr.Runtime.NoViableAltException' was thrown.开发者_如何转开发 [TRUNCATE TABLE Exceptions]

Source Error:

any idea why?


TRUNCATE TABLE is not a valid HQL statement.

Use CreateSQLQuery instead of CreateQuery to execute SQL statements.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜