W
wildThought
Playing around with LINQ and:
SqlConnection con = new SqlConnection(@"Data Source=.
\SQLExpress;Initial Catalog=Northwind;Integrated Security=SSPI");
Northwind db = new Northwind(con);
var q =
from c in db.Employees
where c.EmployeeID == 1
select new { c.FirstName, c.LastName, c.HireDate, c.HomePhone };
dataGridView1.DataSource = q;
This produces a grid as Last Name, Hire Date, First Name, Home Phone.
Why is it a different order then my anonymous type? How can I
influence the order of the dataGrid?
SqlConnection con = new SqlConnection(@"Data Source=.
\SQLExpress;Initial Catalog=Northwind;Integrated Security=SSPI");
Northwind db = new Northwind(con);
var q =
from c in db.Employees
where c.EmployeeID == 1
select new { c.FirstName, c.LastName, c.HireDate, c.HomePhone };
dataGridView1.DataSource = q;
This produces a grid as Last Name, Hire Date, First Name, Home Phone.
Why is it a different order then my anonymous type? How can I
influence the order of the dataGrid?