我有一个数据集合,并希望摆脱包含空值或空值的列。示例应如下所示:
REGION | STATE | COUNTY | PROGRAM 1 | PROGRAM 2 | PROGRAM 3 | PROGRAM 4 | ...
------------------------------------------------------------------------------
"North" | null | null | "Foo" | null | "Bar" | null |...
"East" | null | null | "Duh" | null | "Whew" | null |...
结果可能是:
REGION | PROGRAM 1 | PROGRAM 3 | ...
-------------------------------------
"North" | "Foo" | "Bar" | ...
"East" | "Duh" | "Whew" | ...
请注意,空列非常一致(即,STATE 一直为空)。作为一个 LINQ 新手,我不太清楚实现预期结果的正确方法。任何建议/代码示例将不胜感激。