由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
DotNet版 - What's the simplest way to do a Linq join query ?
相关主题
问个sql问题some1 using nhibernate?
请教两个c# sql listview 问题some1 using nhibernate?
Q: c# datetime nullable objects[合集] some1 using nhibernate?
Do we still need DALIs there LINQ for VS 2005?
有人试过.Net 3.0吗?Demos from MIX08
Converting a CSV file to XML using LinQSilverLight能做动画吗?
是不是最近dotnet不济了LINQ vs nHibernate
最不爽的就是c#搞了不少syntax sugar就为了少打几个字 心得:use XPath (+namespace)
相关话题的讨论汇总
话题: table1话题: what话题: name话题: query话题: linq
进入DotNet版参与讨论
1 (共1页)
w*s
发帖数: 7227
1
right now my query in c# looks like this,
Table1Entry bMfi = MyDB.Table1.Single(x => x.Name == "abc");
Table1 is like this {Name, field1, field2}.
now i break Table1 into 2 tables,
Table0 has {id, Name};
Table1 has {id, field1, field2}.
What's the easiest way to do a query based on Name now ?
p*a
发帖数: 592
2
from t0 in Table0
join t1 in Table1
on t0.id == t1.id
where
t0.Name == "abc"
select
new {t0.id, t1.field1, t1.field2};

【在 w*s 的大作中提到】
: right now my query in c# looks like this,
: Table1Entry bMfi = MyDB.Table1.Single(x => x.Name == "abc");
: Table1 is like this {Name, field1, field2}.
: now i break Table1 into 2 tables,
: Table0 has {id, Name};
: Table1 has {id, field1, field2}.
: What's the easiest way to do a query based on Name now ?

w*s
发帖数: 7227
3
cool, thanks !

【在 p*a 的大作中提到】
: from t0 in Table0
: join t1 in Table1
: on t0.id == t1.id
: where
: t0.Name == "abc"
: select
: new {t0.id, t1.field1, t1.field2};

1 (共1页)
进入DotNet版参与讨论
相关主题
心得:use XPath (+namespace)有人试过.Net 3.0吗?
Entity frameworkConverting a CSV file to XML using LinQ
用MyGeneration/CodeSmith生成NHibernate代码是不是最近dotnet不济了
javascript question: possible to know when option items are added to a 最不爽的就是c#搞了不少syntax sugar就为了少打几个字
问个sql问题some1 using nhibernate?
请教两个c# sql listview 问题some1 using nhibernate?
Q: c# datetime nullable objects[合集] some1 using nhibernate?
Do we still need DALIs there LINQ for VS 2005?
相关话题的讨论汇总
话题: table1话题: what话题: name话题: query话题: linq