随笔分类 -  .net基础

sqlserver 优化建议
摘要:1. 应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索引而进行全表扫描。 2.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 3.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索 阅读全文

posted @ 2018-12-26 23:08 月光glory 阅读(754) 评论(0) 推荐(0)

支持多数据库访问组件
摘要:需求千变万化,我们的应用软件要满足支持多个数据库访问,应对以前的代码封闭不能改动。 一 定义数据库基础访问接口 1 /// <summary> 2 /// 数据库访问适配器 3 /// </summary> 4 public interface IDBAccessProvider 5 { 6 7 / 阅读全文

posted @ 2018-05-01 15:03 月光glory 阅读(779) 评论(0) 推荐(0)

DataTable与List集合转化
摘要:用于数据库查询数据转换、批量数据操作转换、导入导出Excel转换 阅读全文

posted @ 2018-04-30 16:49 月光glory 阅读(228) 评论(0) 推荐(0)

sqlserver数据库访问帮助类
摘要:1 /// 2 /// 数据库访问帮助类 3 /// 4 public static class DbHelper 5 { 6 private const string ConnStr = "server=127.0.0.1;database=db_test;Uid=user1;Pwd=Ps123321;"; 7 8 9 /// 10 /// 执行 增、删、改 1... 阅读全文

posted @ 2018-04-30 16:46 月光glory 阅读(195) 评论(0) 推荐(0)

数据库连接字符串
摘要:一 SQL Server Windows身份验证: Data Source=ServerName;Integrated Security=True; SQL Server 身份验证: Data Source=127.0.0.1;Initial Catalog=dwy_db_test;User ID= 阅读全文

posted @ 2018-04-29 19:04 月光glory 阅读(171) 评论(0) 推荐(0)

导航