I have a Entity Framework data mode that I insert to it some stored procedure and for every of those SPs I create a complex type.For example my sp 1 has this complex type:
sp1_result
{
string c1;
string c2;
string c3;
string c4;
}
and for example sp 2 has this complex type:
sp2_result
{
string c1;
string c2;
}
and so on.I want to convert List of this complex results to DataTable but they have different number of columns but their types are equal. How I can write an Extension Method for this?
thanks
which make use of reflection and create
DataTableform theListcollection of the object…