2014-03-05 39 views

回答

0

試試這個:

System.Data.DataRow r = dt.Rows[0]; 
if (r["b"] == System.DbNull.Value) //DbNull assumes the nulls are coming from DB. If they are set to null via your code then you can use good old null instead. 
{ 
    r["b"] = r["a"]; 
    r["c"] = ""; 
    r["d"] = ""; 
}