Linq Query fails after first
-
Hello: I simply want to write multiple queries to assign information.
var q =
from a1 in dt_Jobs.AsEnumerable()
orderby a1.Field("Customer")
select a1.Field("Customer");
var lstCustomer = q.Distinct().ToList();
cboCustomer.DataSource = lstCustomer;q =
from a1 in dt_Jobs.AsEnumerable()
orderby a1.Field("City")
select a1.Field("City");
var lstCity = q.Distinct().ToList();
cboCity.DataSource = lstCity;The first block works, the second fails. How can I achieve something like this?? Thanks!
-
Hello: I simply want to write multiple queries to assign information.
var q =
from a1 in dt_Jobs.AsEnumerable()
orderby a1.Field("Customer")
select a1.Field("Customer");
var lstCustomer = q.Distinct().ToList();
cboCustomer.DataSource = lstCustomer;q =
from a1 in dt_Jobs.AsEnumerable()
orderby a1.Field("City")
select a1.Field("City");
var lstCity = q.Distinct().ToList();
cboCity.DataSource = lstCity;The first block works, the second fails. How can I achieve something like this?? Thanks!
You have already posted this in the C# forum: Linq Query Limitations, more than one query fails - C# Discussion Boards[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Hello: I simply want to write multiple queries to assign information.
var q =
from a1 in dt_Jobs.AsEnumerable()
orderby a1.Field("Customer")
select a1.Field("Customer");
var lstCustomer = q.Distinct().ToList();
cboCustomer.DataSource = lstCustomer;q =
from a1 in dt_Jobs.AsEnumerable()
orderby a1.Field("City")
select a1.Field("City");
var lstCity = q.Distinct().ToList();
cboCity.DataSource = lstCity;The first block works, the second fails. How can I achieve something like this?? Thanks!