110,537
社区成员
发帖
与我相关
我的任务
分享
using (WcfDataEntities DbContext = new WcfDataEntities())
{
var listFields = from a in DbContext.ObjectList
join b in DbContext.FieldList
on a.AutoID equals b.ParentRowID
where a.ObjectName == strTableName && a.ObjectType == "T"
orderby b.Sort
select new MessageInfo
{
AutoID = b.AutoID,
FieldName = b.FieldName + '|' + b.DataType,
FieldNameCh = b.FieldNameCh
};
var listMessage = listFields.ToList<MessageInfo>();
strJsonData = JsonConvert.SerializeObject(listMessage);
}
using (WcfDataEntities DbContext = new WcfDataEntities())
{
var listFields = from a in DbContext.ObjectList
join b in DbContext.FieldList.AsEnumerable()
on a.AutoID equals b.ParentRowID
where a.ObjectName == strTableName && a.ObjectType == "T"
orderby b.Sort
select new MessageInfo
{
AutoID = b.AutoID,
FieldName = b.FieldName + "|" + b.DataType,
FieldNameCh = b.FieldNameCh
};
var listMessage = listFields.ToList<MessageInfo>();
strJsonData = JsonConvert.SerializeObject(listMessage);
}