有人可以提供如何使用连接编写以下sql查询.我不想使用不作为以及如果可能的话,我想,以取代那里的条件也是如此.
SELECT d1.Short_Code
FROM domain1 d1
WHERE d1.Short_Code NOT IN (
SELECT d2.Short_Code
FROM Domain2 d2
)
Run Code Online (Sandbox Code Playgroud)
我正在使用SQL Server 2008
我正在尝试使用最新Entity Framework 4.0的ADO.Net Codefirst功能.作为其中的一部分,我安装 了Microsft的Entity Framework CTP 4,并使用Scott的教程首先创建模型.在教程内部DBContext并DBSet<>指定.有些人可以告诉我们为了访问这个类而使用的引用是什么.
我使用了以下参考文献但是没有任何反应DBContext和DBSet<>
.net c# entity-framework ado.net-entity-data-model entity-framework-4
我最近安装了.net Productivity Power Tools,然后又安装了ReSharper.然而,PPT提供的大部分期货也由ReSharper提供.因此,我想卸载PPT,而不是使用Visual Studio - >工具 - >选项>生产力电动工具禁用PPT的未来.
我该怎么做呢?
我设法让以下工作:
var transactions = from t in context.Transactions
group t.Create_Date_Time by t.Participation_Id
into t1
select new { ParticipationId = t1.Key, CreateDateTime = t1.Max() };
var cases = from c in context.Cases
group c.Create_Date_Time by c.Participation_Id
into c1
select new { ParticipationId = c1.Key, CreateDateTime = c1.Max() };
var interactions = from i in context.Interactions
join pp in context.Party_Participation on i.Party_Id equals pp.Party_Id
group i.Last_Update_Date_Time.HasValue ? i.Last_Update_Date_Time : i.Create_Date_Time
by pp.Participation_Id
into i1
select new { ParticipationId = i1.Key, CreateDateTime = …Run Code Online (Sandbox Code Playgroud) 我想在没有任何外部库(如Google anagram algorithm helper)的帮助下生成给定字符串的anagram输出.
例:
输入字符串="GOD"
输出列表应如下所示:
GOD GO GD OD OG DG DO GOD GDO ODG OGD DGO DOG
var transactions = from t in context.Transactions
group t.Create_Date_Time by t.Participation_Id
into t1
select new { ParticipationId = t1.Key, CreateDateTime = t1.Max() };
var cases = from c in context.Cases
group c.Create_Date_Time by c.Participation_Id
into c1
select new { ParticipationId = c1.Key, CreateDateTime = c1.Max() };
var interactions = (from i in context.Interactions
join pp in context.Party_Participation on i.Party_Id equals pp.Party_Id
group i.Last_Update_Date_Time.HasValue ? i.Last_Update_Date_Time : i.Create_Date_Time by
pp.Participation_Id
into i1
select new {ParticipationId = i1.Key, CreateDateTime = i1.Max()}).AsQueryable();
Run Code Online (Sandbox Code Playgroud)
考虑到上面的代码,以下代码将起作用 …
我有以下代码
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
var entities = new DemoEntities();
var depts = entities.Depts.ToList(); // entity framwork dept table
CollectionViewSource cvs = (CollectionViewSource)CollectionViewSource.GetDefaultView(depts);
}
}
Run Code Online (Sandbox Code Playgroud)
我的目的是在XAML中将此集合绑定到以下窗口资源
<Window.Resources>
<CollectionViewSource x:Key="Departments"/>
</Window.Resources>
Run Code Online (Sandbox Code Playgroud)
运用
CollectionViewSource collectionViewSource = this.FindResource("Departments") as CollectionViewSource;
Run Code Online (Sandbox Code Playgroud)
但是在执行以下代码行时
CollectionViewSource cvs =(CollectionViewSource)CollectionViewSource.GetDefaultView(depts);
它抛出一个异常,并且该异常的内部异常正在跟随
{"Unable to cast object of type 'System.Windows.Data.ListCollectionView' to type 'System.Windows.Data.CollectionViewSource'."}
Run Code Online (Sandbox Code Playgroud)
有人可以通过提供如何使用代码创建CollectionViewSource来帮助我吗?
我正在使用c#和List集合并加载了值.一旦完成,我试图递归地阅读它们,但有些我怎么也无法实现这一点.
以下是我的主要代码.
private static void Main(string[] args)
{
var node = new Node
{
Name = "N1",
Nodes =
new List<Node>
{
new Node { Name = "N1a" },
new Node { Name = "N1b", Nodes = new List<Node> { new Node { Name = "N1B1" } } },
new Node
{
Name = "N1c",
Nodes =
new List<Node> { new Node { Name = "N1C1", Nodes = new List<Node> {new Node{Name = "N1C1A"} } } }
}
}
}; …Run Code Online (Sandbox Code Playgroud)