摘要: 1. 此方法常用在form或者Console Application中,使用时须用要添加Reference,具体做法: 右键点击项目添加“Add Reference”,在com组件下,选择“Microsoft Excel 14.0 Object Library”,然后在项目中使用 下面注释//it looks like excele table start with 1 not 1 应该为//it looks like excele table start with 1 not0?private static void exportToExcel(DataTable dt) { Excel.. 阅读全文
posted @ 2012-09-05 14:16 郑松涛 阅读(390) 评论(0) 推荐(0) 编辑
摘要: this.repositoryItemComboBox1.Items.Clear(); DataTable dt = (DataTable)bindingSource_DayProp.DataSource; for (int i = 0; i < dt.Rows.Count; i++) { string str = dt.Rows[i][1].ToString(); this.repositoryItemComboBox1.Items.Add(str); } 阅读全文
posted @ 2012-08-30 21:23 郑松涛 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 在项目中经常用到DataTable,如果DataTable使用得当,不仅能使程序简洁实用,而且能够提高性能,达到事半功倍的效果,现对DataTable的使用技巧进行一下总结。 一、DataTable简介(1)构造函数DataTable() 不带参数初始化DataTable 类的新实例。DataTable(string tableName) 用指定的表名初始化DataTable 类的新实例。DataTable(string tableName, string tableNamespace) 用指定的表名和命名空间初始化DataTable 类的新实例。(2) 常用属性CaseSensitive 指 阅读全文
posted @ 2012-08-23 11:35 郑松涛 阅读(423) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/sage425/article/details/6600772 阅读全文
posted @ 2012-08-22 21:30 郑松涛 阅读(145) 评论(0) 推荐(0) 编辑
摘要: #region 初始化资料查询界面 public void InitFeelsInfoGrid() { EatGood.Model.FoodManage.SearchFeelKind model = new EatGood.Model.FoodManage.SearchFeelKind(); model.FShopId = fshopid.ToString(); #region 动态组织SQL语句 string stre = null; for (int i = 0; i < checkedListBox2.Items.Count; i++) { if (checkedListBox2. 阅读全文
posted @ 2012-08-22 13:43 郑松涛 阅读(193) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace EatGood.Model.FoodManage{ /// <summary> /// 食法要求查询:动态查询Model /// 郑松涛 /// </summary> public class SearchFeelKind { #region 筛选参数 private string _ShopId = null; private string _Kindname = null; priva 阅读全文
posted @ 2012-08-22 13:38 郑松涛 阅读(182) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace EatGood.BLL.FoodManage{ public class GetCNSpell { /// <summary> /// 提取汉字首字母 /// </summary> 施彪 /// <param name="strText">需要转换的字</param> /// <returns>转换结果</returns> 阅读全文
posted @ 2012-08-22 13:29 郑松涛 阅读(151) 评论(0) 推荐(0) 编辑
摘要: datatable 转换Excel 阅读全文
posted @ 2012-08-22 13:20 郑松涛 阅读(2416) 评论(0) 推荐(0) 编辑
摘要: 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 17:20 郑松涛 阅读(197) 评论(0) 推荐(0) 编辑