Error CS0266 : Cannot implicitly convert typeWhat is the error?
DataTable
so it can't be assigned to a variable of that type. If you want a DataTable
, you have to create one. LINQ to DataSet does provide a CopyToDataTable
method but that's not going to work in your case anyway, because you have performed grouping in your query so the result does not contain DataRows
. If you want a new DataTable
with a different schema to the old one, you're going to have to create it manually. If you're still confused, maybe you should provide more detail about your current input and your expected output.SelectMany()
to try to flatten the grouping back down to data rows, and then use the CopyToDataTable()
.True, but that seems like it would probably defeat the purpose of the grouping in the first place. I'm not sure that we have enough information to tell for sure either way. Mind you, the OP did say this:Or he could do aSelectMany()
to try to flatten the grouping back down to data rows, and then use theCopyToDataTable()
.
so I'm not sure whether that means that it's a class assignment and they're not allowed to useThe method of adding System.Data.DatasetExtention is Excluded.
CopyToDataTable
anyway.Or he could do aSelectMany()
to try to flatten the grouping back down to data rows, and then use theCopyToDataTable()
.
Or he could do aSelectMany()
to try to flatten the grouping back down to data rows, and then use theCopyToDataTable()
.
Given that the OP is @patrick , he or she (since they seem to be the body double of @Anwind) always seems to have some odd arbitrary inexplicable restriction, that would not be surprising.so I'm not sure whether that means that it's a class assignment and they're not allowed to useCopyToDataTable
anyway.
Please help me ㅠㅠ
If you're still confused, maybe you should provide more detail about your current input and your expected output.
Please help me ㅠㅠ