我遇到了 linq c# 的问题,我的数据库中有三个表首先是 tbl_ActivitiesMaster (this contain Parent Child Data)
CREATE TABLE
tbl_ActivityMaster
(intActivityId int IDENTITY(1,1) NOT NULL,
strActivityDesc varchar(max) NULL,
intActivityUOMId int,
dtDatetime datetime,
IsParentActivity int,
IsAlerternateActivity int NULL,
intParentToId int NULL,
intTaskId int NULL,
intAlternateId int NULL,
CONSTRAINT PK_tbl_ActivityMaster PRIMARY KEY CLUSTERED (
[intActivityId] ASC )
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS
= ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY] ) ON [PRIMARY]
其次是tbl_TendersTaskActivities
CREATE TABLE tbl_TendersTaskActivities(
intID [int] IDENTITY(1,1) NOT NULL,
intTaskId [int] NULL,
intTenderId [int] NULL,
intProjectWorkGroupId [int] NULL,
intActivityId [int] NULL,
ftActivityQty [float] NULL,
ftActivityRate [float] NULL,
intUomId int NULL,
dtTaskStartDate [datetime] NULL,
dtTaskCompletionDate [datetime] NULL,
intFlag [int] NULL,
IsCanceled [bit] NULL,
CONSTRAINT [PK_tbl_TendersTask] PRIMARY KEY CLUSTERED
(
[intID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
我想要来自表 tbl_TendersTaskActivities 的数据,其中活动的父级作为层次结构输出请有人可以解决这个问题提前谢谢。