我有两个整数列表(List<int>).它们包含相同的元素,但列表1包含不在列表2中的元素.
如何查找列表1中哪些元素不在列表2中.
谢谢 :)
PS.郎是c#
LINQ to SQL中的一件好事是一种快速可靠的方法来映射数据库表并将它们转换为可从c#项目访问的类.但是,不再建议使用LINQ to SQL创建项目.
它的替代品是什么?如果我想拥有与LINQ to SQL相同的功能,我今天应该在VS 2010中使用什么样的工具?
在项目的属性中,我创建了这样的设置
NumberOfUsers int User 10
Run Code Online (Sandbox Code Playgroud)
列是名称,类型,范围和值.
然后有一个ComboBox,用户可以在其中设置'NumberOfUsers'.此组合具有SelectedIndexChanged事件,每当用户更改组合的值时,我都会保存更改.这是代码:
Settings.Default.NumberOfUsers = combo1.SelectedIndex;
Settings.Default.Save();
Run Code Online (Sandbox Code Playgroud)
具有此组合的表单从父表单调用,frm.ShowDialog();并在子表单的构造函数中调用我尝试根据设置条目设置组合的选定索引
combo1.SelectedIndex = Settings.Default.NumberOfUsers;
Run Code Online (Sandbox Code Playgroud)
但是,这不起作用,即组合不会从设置中提取值,而是默认为0作为选定索引.
谁知道我弄错了?
我有一个对话框形式的组合框.我需要用父表单中的List <>填充此组合.怎么做,因为我不能通过对话框构造函数传递List <>.
frmChild frm = new frmChild();
frm.ShowDialog();
Run Code Online (Sandbox Code Playgroud) 我有这个脚本在sql server 2005中工作
-- t-sql scriptlet to drop all constraints on a table
DECLARE @database nvarchar(50)
DECLARE @table nvarchar(50)
set @database = 'dotnetnuke'
set @table = 'tabs'
DECLARE @sql nvarchar(255)
WHILE EXISTS(select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where constraint_catalog = @database and table_name = @table)
BEGIN
select @sql = 'ALTER TABLE ' + @table + ' DROP CONSTRAINT ' + CONSTRAINT_NAME
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS
where constraint_catalog = @database and
table_name = @table
exec sp_executesql @sql
END
Run Code Online (Sandbox Code Playgroud)
它在SQL Server 2008中不起作用.如何轻松删除某个表的所有外键约束?有没有人有更好的脚本?