小编Ela*_*esh的帖子

如何使用join编写"not in()"sql查询

有人可以提供如何使用连接编写以下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

sql t-sql sql-server notin

45
推荐指数
3
解决办法
11万
查看次数

实体框架中DBContext,DBSet <>的引用

我正在尝试使用最新Entity Framework 4.0的ADO.Net Codefirst功能.作为其中的一部分,我安装 了Microsft的Entity Framework CTP 4,并使用Scott的教程首先创建模型.在教程内部DBContextDBSet<>指定.有些人可以告诉我们为了访问这个类而使用的引用是什么.

我使用了以下参考文献但是没有任何反应DBContextDBSet<>

  • System.Data.Entity的
  • System.Data.Entity.Design

.net c# entity-framework ado.net-entity-data-model entity-framework-4

22
推荐指数
2
解决办法
6万
查看次数

如何卸载.net Productivity Power Tools(PPT)?

我最近安装了.net Productivity Power Tools,然后又安装了ReSharper.然而,PPT提供的大部分期货也由ReSharper提供.因此,我想卸载PPT,而不是使用Visual Studio - >工具 - >选项>生产力电动工具禁用PPT的未来.

我该怎么做呢?

.net visual-studio-2010 visual-studio-power-tools

14
推荐指数
1
解决办法
9461
查看次数

LINQ to Entities Union正在抛出错误

我设法让以下工作:

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)

c# linq linq-to-entities entity-framework

9
推荐指数
1
解决办法
8859
查看次数

如何在纯C#和.Net框架中编写anagram生成器

我想在没有任何外部库(如Google anagram algorithm helper)的帮助下生成给定字符串的anagram输出.

例:

输入字符串="GOD"

输出列表应如下所示:

GOD GO GD OD OG DG DO GOD GDO ODG OGD DGO DOG

.net c# anagram c#-4.0

6
推荐指数
1
解决办法
4950
查看次数

如何将Linq.ParallelQuery转换为Linq.IQueryable

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)

考虑到上面的代码,以下代码将起作用 …

c# linq linq-to-objects linq-to-entities entity-framework

6
推荐指数
1
解决办法
7093
查看次数

如何在wpf app后面的代码中创建集合视图源

我有以下代码

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来帮助我吗?

.net c# wpf xaml observablecollection

4
推荐指数
1
解决办法
2万
查看次数

集合中的递归函数

我正在使用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)

c# recursion function

2
推荐指数
1
解决办法
6074
查看次数