0
それは私にエラーが発生しますタイプのオブジェクトをキャストできません。Linq SQLへの問題
public class CusInfomration
{
public string CustomerName { get; set; }
public string CustomerID { get; set; }
public string OrderDate { get; set; }
public string OrderId { get; set; }
}
var CustomerFromWash = from p in _NorthWindDataContext.Customers
join q in _NorthWindDataContext.Orders
on p.CustomerID equals q.CustomerID
where p.Region == "WA"
select new
{
CustomerName =Convert.ToString(p.CompanyName),
CustomerID = Convert.ToString(p.CustomerID),
OrderId = Convert.ToString(q.OrderID),
OrderDate = Convert.ToString(q.OrderDate),
};
List<cusinfomration> lstCust = (List<cusinfomration>)CustomerFromWash;