Linq random rows
Posted: Wed 03 Jul 2013 20:36
Hi.
I want do that:
With Visual Studio 2012 ado.net entity data model I can do that and no error. But with you LinqConnect model I cant, give me an error.
"Error on executing DbCommand."
InnerException: "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."
I must get data from sql from this way:
I dont want to use Ado.Net entity model and SQL command.
I bought you component and I like it. There is any way to do that in LinqConnect model?
Thanks
PS: My goal is get rows randomly, Im using Microsoft Sql Server
I want do that:
Code: Select all
var products = db.Styles.OrderBy(e => Guid.NewGuid()).ToList();
"Error on executing DbCommand."
InnerException: "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."
I must get data from sql from this way:
Code: Select all
SELECT * FROM styles ORDER BY NEWID()
I bought you component and I like it. There is any way to do that in LinqConnect model?
Thanks
PS: My goal is get rows randomly, Im using Microsoft Sql Server