[Exception]=NHibernate.Exceptions.GenericADOException: could not execute batch command.[SQL: SQL not available] ---> System.Data.SqlClient.SqlException: 不允许从数据类型 nvarchar 到 varbinary 的隐式转换。请使用 CONVERT 函数来运行此查询。
在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
在 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
在 System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
在 System.Data.SqlClient.SqlCommandSet.ExecuteNonQuery()
在 NHibernate.AdoNet.SqlClientSqlCommandSet.ExecuteNonQuery()
在 NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand ps)
--- 内部异常堆栈跟踪的结尾 ---
在 NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand ps)
在 NHibernate.AdoNet.AbstractBatcher.ExecuteBatchWithTiming(IDbCommand ps)
在 NHibernate.AdoNet.AbstractBatcher.ExecuteBatch()
在 NHibernate.AdoNet.AbstractBatcher.OnPreparedCommand()
在 NHibernate.AdoNet.AbstractBatcher.PrepareCommand(CommandType type, SqlString sql, SqlType[] parameterTypes)
在 NHibernate.AdoNet.AbstractBatcher.PrepareBatchCommand(CommandType type, SqlString sql, SqlType[] parameterTypes)
在 NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
在 NHibernate.Persister.Entity.AbstractEntityPersister.UpdateOrInsert(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
在 NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection, Object[] oldFields, Object oldVersion, Object obj, Object rowId, ISessionImplementor session)
在 NHibernate.Action.EntityUpdateAction.Execute()
在 NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
在 NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
在 NHibernate.Engine.ActionQueue.ExecuteActions()
在 NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
在 NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
在 NHibernate.Impl.SessionImpl.Flush()
在 NHibernate.Transaction.AdoTransaction.Commit()
在 Eap.Models.VoteOnline.Servers.VoteMobileService.ItemMutilVote(ItemMutilVoteDto dto)****** End ******
大哥大姐们救命啊,莫名其妙,我的数据库里面从来都没有varbinary 这个类型,怎么保存的时候就出现这样的错误啊!
var result = _sportsService.SaveRouteCheatInfo(new RouteCheatInfoDto
{
RouteId = route.rid,
Detail = routeinfoString,
IsCheat = false
});
就是提交保存事务的时候。。。
查看相应的 *.hbm.xml 中字段的 sql-type