我正在尝试创建一个多布局主屏幕应用程序.我在顶部有一些链接到应用程序主要部分的按钮(例如模型中每个实体的管理窗口)
单击任何这些按钮将在Panel中显示关联的UserControl.Panel持有UserControls,而UserControls又拥有UI.
WinForms UserControl没有Anchor或Dock属性.
我试过设置UserControl的属性
AutoSize=True
Run Code Online (Sandbox Code Playgroud)
和
private void ManageUsersControl_Load(object sender, EventArgs e)
{
this.Width = this.Parent.Width;
this.Height = this.Parent.Height;
}
Run Code Online (Sandbox Code Playgroud)
但这些都行不通.
注意:我在运行时动态加载此控件
我正在sql server上执行一些测试,我想获得最佳的插入速度.我使用的陈述是这样的:
INSERT INTO db_Test_databse..tbl_test with(rowlock)
( joinid, date_key,
col1, col2,col3,col4, col5, col6, col7, col8, col9, col10, ...
)
SELECT tabid as joinid,
date_key,
rec_type,
col2,
dbo.udf_convert_hex_to_dec(col3),
col4, col5, col6, col7, col8,
dbo.udf_convert_hex_to_dec(col9),
dbo.udf_convert_hex_to_dec(col10),
...
from source_table f
Run Code Online (Sandbox Code Playgroud)
共有25列; 其中大多数是bigint或int类型.
我删除了目标表中的所有索引,除了作为标识字段的主键.
有关如何提高性能的任何提示?
Ps在这种形式中,我的平均速度为16.000行/秒.
我可以这样做吗?
create table #tbl_tmp (col1 int)
insert into #tbl_tmp select 3
exec sp_rename '#tbl_tmp','tbl_new'
Run Code Online (Sandbox Code Playgroud) 喜!
如何创建聚合函数以获取聚合值的列表.
给出:
key value
Andrei 1
Andrei 2
Andrei 3
Mihai 4
Mihai 5
Mihai 6
Run Code Online (Sandbox Code Playgroud)
我想要
key list
Andrei 1,2,3
Mihai 4,5,6
Run Code Online (Sandbox Code Playgroud) 是否可以在SQL Server 2008 Management Studio中创建新的菜单项?
例如,当您右键单击数据库时,会出现一个选项列表(新数据库,新查询...).
是否可以在该列表中添加新项目并在单击该按钮时实现一些C#功能?
我试图在t-sql中的OUTPUT子句上使用过滤器.
我想做的是这样的:
Insert into tbl_1(col1,col2)
Output Inserted.col1 into #tbl_temp
**where col1 > 0**
select col3, col4
from tbl_2
Run Code Online (Sandbox Code Playgroud)
出于性能原因,我不想使用两个插入语句.
我在将字符串(表示十六进制数字)转换为bigint时遇到了一些麻烦.我也希望这能在一个函数内部发生并且尽可能高效.无论如何都在利用内置函数?这是我想要做的一个例子:
select convert (bigint, '0000010d1858798c')
Run Code Online (Sandbox Code Playgroud) 我有下表:
CREATE TABLE tbl_proc(
[proc] float,
subscriber bigint
)
Run Code Online (Sandbox Code Playgroud)
数据:
proc | subscriber
-----|-----------
0.7 | 123456
0.5 | 1234567
0.3 | 12345
0.3 | 45678
0.3 | 1234
0.2 | 123455
0.1 | 894562
Run Code Online (Sandbox Code Playgroud)
我想找到一个很好的方法来向表中添加一个新列,表示上述值的总和.
结果:
proc | subscriber | col3
-----|------------|------------
0.7 | 123456 | 0.7
0.5 | 1234567 | 1.2 -- 0.7 + proc
0.3 | 12345 | 1.5
...
Run Code Online (Sandbox Code Playgroud)
我找到了以下方法:
Select a.[proc],SUM(b.[proc])
from tbl_proc a, tbl_proc b
where a.[proc] <= b.[proc] and (a.[proc] <> b.[proc] or …Run Code Online (Sandbox Code Playgroud) 我想将目录中的所有文件合并为一个.但是我尝试了几个版本但它们似乎都没有用.我收到一个错误,说找不到该文件.这是我在尝试的:
String outputFile = this.outputTxt.Text;
String inputFolder = this.inputTxt.Text;
String files = "";
String command;
foreach (String f in Directory.GetFiles(inputFolder))
{
files += f+"+";
}
files = files.Substring(0, files.Length - 1);
command = files + " " + outputFile;
Process.Start("copy",command);
Run Code Online (Sandbox Code Playgroud)
我想要获得的样本:复制a.txt + b.txt + c.txt + d.txt output.txt
而我得到的错误是:
System.dll中出现未处理的"System.ComponentModel.Win32Exception"类型异常
附加信息:系统找不到指定的文件