随笔分类 -  C#

摘要:ASP.NET在调用Office Com组件时,经常会出现权限限制的问题,而出现如下错误:现通过以下几步设置,可解决上述问题:(1)64位系统中,请在IIS应用程序池集成模式中应启用调用32位应用程序,或设应用程序池的模式应为”经典“(2)设置DCOM,在“开始”-“运行”中运行命令:Dcomcnf... 阅读全文
posted @ 2014-06-17 22:26 --宁静以致远-- 阅读(1884) 评论(0) 推荐(0)
摘要:public static class ExtendMethods { /// /// 绑定列表控件 /// /// 列表控件 /// 数据表 public static void BindListControl(this ListControl listControl, DataTable dt) { if (dt != null) { listControl.DataSource = dt; ... 阅读全文
posted @ 2014-02-21 09:58 --宁静以致远-- 阅读(156) 评论(0) 推荐(0)
摘要:static class TestExtend { /// /// 判断是否有重复添加 /// /// /// /// /// /// public static void AddSingle(this Dictionary dict, Tkey key, TValue value) { if (!dict.ContainsKey(key)) { dict... 阅读全文
posted @ 2013-11-13 23:29 --宁静以致远-- 阅读(158) 评论(0) 推荐(0)
摘要://冒泡排序 private static void SortByMP() { int[] array = new int[] { 23, 33, 34, 143, 167, 278, 179, 108 }; int temp; for (int i = 0; i array[j]) { temp = array[i]; array[i] = array[... 阅读全文
posted @ 2013-07-31 16:39 --宁静以致远-- 阅读(157) 评论(0) 推荐(0)
摘要:private static void QueryByMid() { int[] array = new int[] { 23, 33, 34, 43, 67, 78, 79 }; int low = 0; int high = array.Length - 1;//这句很重要,减1避免数组值比较时索引超出 int mid = 0; int queryNum = 78;//待查找的数 int queryIndex = -1; ... 阅读全文
posted @ 2013-07-31 14:59 --宁静以致远-- 阅读(204) 评论(0) 推荐(0)
摘要:class Program { static void Main(string[] args) { GetListTest(); } private static void GetListTest() { DBHelper dbHelper = DBHelper.GetInstance(); DataSet ds = dbHelper.GetSqlDataSet("SELECT name,age FROM tbl_test",null); ... 阅读全文
posted @ 2013-07-31 09:41 --宁静以致远-- 阅读(290) 评论(0) 推荐(0)
摘要:class DBHelper { private static readonly string strConn = "Data Source=.;Integrated Security=true;Initial Catalog=myDB"; private static SqlConnection sqlConn = null; private static DBHelper dbHelper = null; /// /// 数据库连接对象实例 /// private DBHel... 阅读全文
posted @ 2013-07-30 23:29 --宁静以致远-- 阅读(212) 评论(0) 推荐(0)