을 확인 (행 [somecolumn])이 코드를 작성하는 더 좋은 방법이 있나요 .. 가이 작업을 수행 할 수있는 더 좋은 방법입니다 Convert.IsDBNull
MyObject pymt = new MyObject();
pymt.xcol1id= Convert.IsDBNull(row["col1id"]) ? 0 : (int)row["col1id"];
pymt.xcold2id= Convert.IsDBNull(row["col2id"]) ? String.Empty : (string)row["col2id"];
pymt.xcold3id = Convert.IsDBNull(row["CustNum"]) ? 0 : (decimal)row["xcold3id"];
이 깨끗한 방법으로 할 수 있습니다 .. 일반적인 방법 등?
가능한 중복 http://stackoverflow.com을/questions/221582/most-efficient-way-to-a-variable에 dbnull-and-assign-to-a-variable에 할당) – nawfal