Issues
- Mô tả chung về lỗiNHB-53Resolved issue: NHB-53
- Method Not Found Error : System.Data.IDbConnection NHibernate.ISession.Close()NHB-48Kailuo Wang
- ERRORES ENCONTRADOSNHB-32Kailuo Wang
- Need to Customize the 'Configuration' in run time,NHB-31Kailuo Wang
- Release a 3.0.0 Alpha 1 buildNHB-30Kailuo Wang
- Release a 2.1.2 buildNHB-29Kailuo Wang
- Null reference exception thrown in Sniffer() method of WebUtilHTTPModuleNHB-28Kailuo Wang
- Session.Close vs Session.Dispose in NH 2.1NHB-27Kailuo Wang
- Burrow does support only 1 nesting levelNHB-26Resolved issue: NHB-26Kailuo Wang
- Update to NHibernate 2.1.xNHB-25Resolved issue: NHB-25Kailuo Wang
- Burrows forces databinding on controls, even if we don't want toNHB-24Kailuo Wang
- Improve WEbUtilHttpModule to ignore unecessary HandlersNHB-23Resolved issue: NHB-23Kailuo Wang
- Burrow throws a null reference exception when added as a module in IIS7 and static content is servedNHB-22Resolved issue: NHB-22Kailuo Wang
- QueryString should not be parsed for Conversation information during postbackNHB-21Resolved issue: NHB-21Kailuo Wang
- Get a session by persistence unit name instead by class typeNHB-20Resolved issue: NHB-20Kailuo Wang
- An interceptor for configuring NHConfiguration before Burrow creates SessionFactoryNHB-19Resolved issue: NHB-19Kailuo Wang
- using a ControlAdapter for Page and UserControl to load/save the state instead of traversing the control treeNHB-18Kailuo Wang
- Provide ways to stop stateful field processor from traverse control treeNHB-17Resolved issue: NHB-17Kailuo Wang
- NHibernate.Burrow causes controls on the page to DataBind too early in the page cycleNHB-16Resolved issue: NHB-16Kailuo Wang
- Clean up transaction and session mangement codeNHB-15Resolved issue: NHB-15Kailuo Wang
- Ambiguous match found exception when loading statefulfieldNHB-14Resolved issue: NHB-14Kailuo Wang
- Update to NH 2.0.1 GANHB-13Resolved issue: NHB-13Kailuo Wang
- Exception when used in a page without formNHB-12Resolved issue: NHB-12Kailuo Wang
- Naming incorrect persistantUnits should be persistenceUnitsNHB-11Resolved issue: NHB-11Kailuo Wang
- Assembly info should be excluded from proj and svnNHB-10Resolved issue: NHB-10Kailuo Wang
- Flush mode should be reset after Business transaction is finishedNHB-9Resolved issue: NHB-9Kailuo Wang
- Get the NHibernate.Cfg.Configuration for each PersistentUnitNHB-8Resolved issue: NHB-8Kailuo Wang
- Mark Assemblies with Allow Partially Trusted Callers by DefaultNHB-7Resolved issue: NHB-7Kailuo Wang
- Test script does not copy artifacts needed for MultiDB TestNHB-6Resolved issue: NHB-6Kailuo Wang
- PersistantUnitRepo cannot be called before Envrionment startsNHB-5Resolved issue: NHB-5Kailuo Wang
- BurrowEnvironment.Shutdown should reset all SessionFactoriesNHB-4Resolved issue: NHB-4Kailuo Wang
- DeletableEntityBase doesn't deleteNHB-3Resolved issue: NHB-3Kailuo Wang
- Unhandled MappingException in PersistentUnitRepo:GetPU(Type t)NHB-2Resolved issue: NHB-2Kailuo Wang
- Features were moved from uNHAddins, but not added to the projectNHB-1Resolved issue: NHB-1Kailuo Wang
34 of 34
In order to select random rows people usually order by NEWID(). Doing this in Linq generates invalid SQL
Generated SQL:
exec sp_executesql N'select user0_.UserId as UserId40_, user0_.Name as Name40_, user0_.InvalidLoginAttempts as InvalidL3_40_, user0_.RegisteredAt as Register4_40_, user0_.LastLoginDate as LastLogi5_40_, user0_.Enum1 as Enum6_40_, user0_.Enum2 as Enum7_40_, user0_.Features as Features40_, user0_.RoleId as RoleId40_, user0_.Property1 as Property10_40_, user0_.Property2 as Property11_40_, user0_.OtherProperty1 as OtherPr12_40_ from Users user0_ order by @p0 asc',N'@p0 uniqueidentifier',@p0='44381DF7-8A67-4EC9-9EAB-E38F3481A05E'
Error message:
WARN ADOExceptionReporter:0 - System.Data.SqlClient.SqlException (0x80131904): The SELECT item identified by the ORDER BY number 1 contains a variable as part of the expression identifying a column position. Variables are only allowed when ordering by an expression referencing a column name.
The Guid is always passed in as a constant expression. NEWID() is a non-deterministic function (at least in SQL-Server) and returns a different result for each row.
As a workaround the query could be done via Hql.
I've downloaded the source and tried to get this working in many ways for days but got to the limit of my knowledge.