mardi 3 mars 2015

EF ComplexType fields order

I'm starting working in EF with C# I'm doing an example where simply I execute a SP and I need to retrieve to a DataGridView.


I add the SP and create a complex type and my SP looks like this



select ProductId, ProductName, S.SupplierID, S.CompanyName,
C.CategoryID, C.CategoryName, UnitPrice
from dbo.Products P
inner join Suppliers S on S.SupplierID = P.SupplierID
inner join Categories C on C.CategoryID = P.CategoryID


But, when I retrieve the data to the DataGridView the Complex type shows the result in a different order, actually it shows like this



ProductName, SupplierID, CategoryID (...)


So I want to know if there is any chance to modify my complexType and get the output in the same order of my SP?


Aucun commentaire:

Enregistrer un commentaire