I have a problem with Executequery: Error message: "The specified order is invalid." I tried:
var qq = db.ExecuteQuery<class_search>(query, ddl4, ddl5, ddl1).ToList();
But the same mistake, too. I tried several more times. Always this error or "Query results cannot be listed more than once" when I tried to make IEnumerable. I have read many articles, but I do not know how to do this. What am I doing wrong or missing?
public class class_search
{
public string path_image
{ get; set; }
public string name_product
{ get; set; }
public float cost
{ get; set; }
}
public partial class Search : System.Web.UI.Page
{
DataClasses1DataContext db = new DataClasses1DataContext();
string ddl4 = DropDownList4.SelectedItem.Value;
string ddl5 = DropDownList5.SelectedItem.Value;
string ddl1 = DropDownList1.SelectedItem.Value;
string query = "select p.path_image, p.name_product, p.cost from Table1 a, Table2 p, Table3 k where a.column1 = {0} and a.column2 = {1} and k.column2 = {2} and p.IDForeignColumn1 = k.IDcolumn and p.IDForeignColumn2 = a.IDcolumn"
var qq = db.ExecuteQuery<class_search>(query, ddl4, ddl5, ddl1);
ListView1.DataSource = qq;
ListView1.DataBind();
}
// I changed the code to English. Now a.column1, a.column2 and k.column2 are string types.
source
share