日期:2014-05-20 浏览次数:20822 次
CREATE TABLE [dbo].[ConsumeCategory] (
[ConsumeCategoryID] INT IDENTITY (1, 1) NOT NULL,
[ConsumeCategoryName] NVARCHAR (10) NOT NULL,
[BusinessCategoryID] INT NULL)
ConsumeCategoryManager ccm=new ConsumeCategoryManager();
var query =
(from cc in ccm.GetAllConsumeCategory()
where cc.ConsumeCategoryID == Convert.ToInt32(cbb_consumeCategory.SelectedValue)
select cc);
if (query.Single().BusinessCategoryID==null)
{}
var query = ccm.GetAllConsumeCategory().SingleOrDefault(cc=> cc.ConsumeCategoryID == Convert.ToInt32(cbb_consumeCategory.SelectedValue));
if (query!=null &&Nullable<int>.Equals(query.BusinessCategoryID,null) ){}