跟小D每日学口语

编码规范小记

1.查询时不要写数据库名称等信息,防止以后数据库变更而变更代码

隐藏行号 复制代码 这是一段程序代码。
  1. dtRemind = bllConst.Select("ParentID=134 and Visible=1", "ViewOrder").Tables[0];
  2. dtRemind = bllConst.Select("db_owner.Sys_Const.ParentID=134 and db_owner.Sys_Const.Visible=1", "ViewOrder").Tables[0];

2.连接字符串尽量使用StringBuild类的Format()方式,简洁明了而不是字符串的拼接,复杂低效

posted on 2012-04-05 18:10  blankjoin  阅读(195)  评论(0编辑  收藏  举报

导航