摘要: 1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如:select id from t where num is null可以在num上设置默认值0,确保表中num列没有null值,然后这样查询:select id from t where num=03.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索引而进行全表扫描。4.应尽量避免在 where 子句中使用 or 来连接条件,否则将导致引擎 阅读全文
posted @ 2012-02-06 13:17 cntom 阅读(968) 评论(0) 推荐(1) 编辑
摘要: private void TextBoxUpDown_KeyDown(object sender, KeyEventArgs e) { Control ctl = (Control)sender; if (e.KeyCode == Keys.Down) { if (ctl.TabIndex == 7) { tabControl1.SelectedIndex = 1; cbModify.Focus(); this.SelectNextControl(this, true, true, true, true); return; } this.SelectNextC... 阅读全文
posted @ 2012-02-06 10:56 cntom 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 你需要override IsInputKey事件,可是这个时间却在.Net CF2中不支持。此路不通!那么该如何做呢?通过P/Invoke调用!我是向来不喜欢C#的,搞来搞去,很多功能还是需要调用WIN32 API。所以,我们就利用LostFocus或者GetFocus事件发生时,询问键盘键状态。就可以得到是否用户按了Arrow key了。using System.Runtime.InteropServices;[DllImport("Coredll.dll")] private static extern short GetAsyncKeyState(int nVirtK 阅读全文
posted @ 2012-02-06 10:53 cntom 阅读(264) 评论(0) 推荐(0) 编辑