其實很簡單,就是
Area = store.stm_lArea.GetValueOrDefault(0)
Data.dcDataContext dc = new Data.dcDataContext(this.gzConnectionString);
var stores = from store in dc.StoreMaster_stm
select new
{
Name = store.stm_cStoreName,
Area = store.stm_lArea.GetValueOrDefault(0),
OpenDate = store.stm_dOpenDate.GetValueOrDefault(DateTime.Parse("2009-10-1")),
Desc = store.stm_cDesc.ToString()
};
GridView1.DataSource = stores;
GridView1.DataBind();