dt.Columns.Add("Elec_Product_Value", typeof(double), " IIF(ProductYield is not null and ProductYield>0 and Elec_Value is not null, Convert(Elec_Value/ProductYield*10000,'System.Int64')/10000, null)");
dt.Columns.Add("Water_Product_Value", typeof(double), " IIF(ProductYield is not null and ProductYield>0 and Water_Value is not null, Convert(Water_Value/ProductYield*10000,'System.Int64')/10000, null)");
dt.Columns.Add("Steam_Product_Value", typeof(double), " IIF(ProductYield is not null and ProductYield>0 and Steam_Value is not null, Convert(Steam_Value/ProductYield*10000,'System.Int64')/10000, null)");
dt.Columns.Add("CA_Product_Value", typeof(double), " IIF(ProductYield is not null and ProductYield>0 and CA_Value is not null, Convert(CA_Value/ProductYield*10000,'System.Int64')/10000, null)");
dt.Columns.Add("WasteWater_Product_Value", typeof(double), " IIF(ProductYield is not null and ProductYield>0 and WasteWater_Value is not null, Convert(WasteWater_Value/ProductYield*10000,'System.Int64')/10000, null)");
其中:表达式中可以使用IIF(条件,表达式1,表达式2)三元运算符,使用Convert(Elec_Value/ProductYield*10000,'System.Int64')/10000进行保留4位小数位数