每次尝试使用不同的行执行以下代码;得到同样的例外:
var result = (from prod in context.ProductsTbls
join img in context.ProductImagesTbls
on prod.Id equals img.ProductId
where prod.UserId == 4 && img.IsDefaultImage ==true
select new
{
Image = img.Image
}).ToList();
IEnumerable<Object> data = result.ToList();
DataTable table = new DataTable();
using (var reader = ObjectReader.Create(data , "Image"))
{
table.Load(reader); // Exception appears here
}
并得到这个例外:
System.ArgumentOutOfRangeException: 'Specified argument was out of the range of valid values. Parameter name: name'
请帮助我解决这个问题。