2012年9月8日
摘要: View Code using System;using System.Collections.Generic;using System.ComponentModel;using System.Windows.Forms;using DevExpress.XtraGrid.Columns;using DevExpress.XtraGrid.Views.Base;using DevExpress.XtraGrid.Views.BandedGrid;using DevExpress.XtraEditors.Repository;namespace XtraGridDemo1{ public ... 阅读全文
posted @ 2012-09-08 16:26 爱搁浅 阅读(7801) 评论(2) 推荐(2) 编辑
摘要: 1、 如何解决单击记录整行选中的问题View->OptionsBehavior->EditorShowMode 设置为:Click2、 如何新增一条记录(1)、gridView.AddNewRow()(2)、实现 gridView_InitNewRow 事件3、如何解决 GridControl 记录能获取而没有显示出来的问题gridView.populateColumns();4、如何让行只能选择而不能编辑(或编辑某一单元格)(1)、View->OptionsBehavior->EditorShowMode 设置为:Click(2)、View->OptionsBe 阅读全文
posted @ 2012-09-08 16:15 爱搁浅 阅读(48364) 评论(9) 推荐(13) 编辑
摘要: 对DataTable进行过滤筛选的一些方法Select,dataview当你从数据库里取出一些数据,然后要对数据进行整合,你很容易就会想到:DataTable dt = new DataTable();//假设dt是由"SELECT C1,C2,C3 FROM T1"查询出来的结果 for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["C1"].ToString() == "abc")//查询条件 { //进行操作 } }但这种做法用一两次还好说,用多了就累了。那有没 阅读全文
posted @ 2012-09-08 16:09 爱搁浅 阅读(513) 评论(0) 推荐(0) 编辑
  2012年9月4日
摘要: 转自http://blog.sina.com.cn/s/blog_59e14b9f0100t7xd.html1.隐藏最上面的GroupPanel gridView1.OptionsView.ShowGroupPanel=false;2.得到当前选定记录某字段的值 sValue=Table.Rows[gridView1.FocusedRowHandle][FieldName].ToString();3.数据只读 gridView1.OptionsBehavior.Editable=false;4.不显示MasterDetailView gridView1.OptionsDetail.Enable 阅读全文
posted @ 2012-09-04 22:39 爱搁浅 阅读(7934) 评论(0) 推荐(3) 编辑
  2012年8月29日
摘要: 控件using System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using System.Data;using System.Linq;using System.Text;using System.Windows.Forms;namespace testconroler{ public partial class UserControl1 : UserControl { public UserControl1() { ... 阅读全文
posted @ 2012-08-29 16:28 爱搁浅 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 筛选DataTable数据的方法对DataTable进行过滤筛选的一些方法Select,dataview当你从数据库里取出一些数据,然后要对数据进行整合,你很容易就会想到:DataTable dt = new DataTable();//假设dt是由"SELECT C1,C2,C3 FROM T1"查询出来的结果 for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["C1"].ToString() == "abc")//查询条件 { //进行操作 } }但这种做法用一 阅读全文
posted @ 2012-08-29 16:22 爱搁浅 阅读(222) 评论(0) 推荐(0) 编辑
  2012年8月22日
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace GetCNSpell{ public class GetCNSpell { /// <summary> /// 提取汉字首字母 /// </summary> 施彪 /// <param name="strText">需要转换的字</param> /// <returns>转换结果</returns> public stri 阅读全文
posted @ 2012-08-22 20:09 爱搁浅 阅读(323) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/fwacky/article/details/5538147一、简介 xp_cmdshell 扩展存储过程将命令字符串作为操作系统命令 shell 执行,并以文本行的形式返回所有输出。三、SQL Server 2005中的xp_cmdshell 由于存在安全隐患,所以在SQL Server 2005中, xp_cmdshell 默认是关闭的。 此时,如果执行 xp_cmdshell 将会提示服务未开启: exec xp_cmdshell 'dir c:/'消息 15281,级别 16,状态 1,过程 xp_cmdshell,第 1 行S 阅读全文
posted @ 2012-08-22 13:20 爱搁浅 阅读(19431) 评论(0) 推荐(0) 编辑
摘要: ①关于关键词 DISTINCT:在表中,可能会包含重复值。这并不成问题,不过,有时您也许希望仅仅列出不同(distinct)的值。关键词 DISTINCT 用于返回唯一不同的值。SELECT DISTINCT Company FROM Orders ②SQL 使用单引号来环绕文本值(大部分数据库系统也接受双引号)。如果是数值,请不要使用引号。文本值:这是正确的:SELECT * FROM Persons WHERE FirstName='Bush'这是错误的:SELECT * FROM Persons WHERE FirstName=Bush数值:这是正确的:SELECT * 阅读全文
posted @ 2012-08-22 10:39 爱搁浅 阅读(239) 评论(0) 推荐(0) 编辑
  2012年8月21日
摘要: public static void ToExcelSheet(DataSet ds, string fileName) { //int testnum = ds.Tables.Count-1; SaveFileDialog saveDialog = new SaveFileDialog(); saveDialog.DefaultExt = "xls"; saveDialog.Filter = "Excel文件|*.xls"; saveDialog.FileName = fileName; saveDialog.ShowDialog(); fileNam 阅读全文
posted @ 2012-08-21 11:37 爱搁浅 阅读(4981) 评论(1) 推荐(0) 编辑