This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm probably doing something wrong, but here it goes. I'm having a couple of tables, of which two are Client and Vehicle. Vehicle has a ClientId FK. So, I'm now constructing a query like: var clientsWithMultipleVrn = repository.Context.Clients .Where(c => c.Vehicles.Count() > 0).First(); Where Context is the generated UnitOfWork implementation. All other simple queries work, like getting first client and then browse into the vehicles work. The code above however throws an exception: System.Data.SqlClient.SqlException : Invalid column name RowNumber. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) 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() at ...() at ..(IUnitOfWork , IDbCommand , ) at ..(IUnitOfWork , IDbCommand ) at ...ctor(IUnitOfWork, IEnumerable`1) at Mindscape.LightSpeed.Data.DataProviderAdapter.(IUnitOfWork , IEnumerable`1 , ProviderOptions ) at ..(TypeModel , Query , IList ) at ..(Query , TypeModel , IList ) at ..(Query , IList ) at Mindscape.LightSpeed.UnitOfWork.Find(Query query, IList results) at Mindscape.LightSpeed.UnitOfWorkBase.Find(Query query) at Mindscape.LightSpeed.Linq.Plan.SingleQueryPlan.ExecuteImmediate(IUnitOfWork unitOfWork, Type returnType) at Mindscape.LightSpeed.Linq.LinqQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) at System.Linq.Queryable.First(IQueryable`1 source)
And the generated sql is indeed missing this Row Number:
exec sp_executesql N'SELECT CLIENT.* FROM ( SELECT sxt0.CLIENT_ID AS [CLIENT_ID], -- ..all other collumnes...-- (SELECT COUNT(sx_CountVehicles.VEHICLE_ID) AS [sx_CountVehicles.VEHICLE_ID] FROM ( SELECT VEHICLE.VEHICLE_ID AS [VEHICLE_ID], VEHICLE.CLIENT_ID AS [CLIENT_ID] FROM VEHICLE ) sx_CountVehicles WHERE sx_CountVehicles.CLIENT_ID = sxt0.CLIENT_ID ) AS CountVehicles FROM CLIENT sxt0 ) CLIENT WHERE RowNumber <= @p0',N'@p0 int',@p0=1
So this crash on row number is correct. Any idea whats going on? I'm using (from dll) version: 3.1.1891.14711 Express edition. Thanks,
|
|
|
Sorry about the double post, but the site gave me a 'We are sorry screen, something went wrong..' so a tried again, not knowing it was already there. Can we close or delete this post and use the previous one?
Thanks, |
|
|
A similar query is working for me in our test environment. We have made some fixes to paging since 3.11 RTMed so could you try it again with the latest nightly (you can get it from the Downloads page) and let us know if that fixes the problem? If you still see the issue, could you provide us with a small buildable console or NUnit project that exhibits the problem please? Thanks! |
|