.NET开发

本类阅读TOP10

·NHibernate快速指南(翻译)
·vs.net 2005中文版下载地址收藏
·【小技巧】一个判断session是否过期的小技巧
·VB/ASP 调用 SQL Server 的存储过程
·?dos下编译.net程序找不到csc.exe文件
·通过Web Services上传和下载文件
·学习笔记(补)《.NET框架程序设计(修订版)》--目录
·VB.NET实现DirectDraw9 (2) 动画
·VB.NET实现DirectDraw9 (1) 托管的DDraw
·建站框架规范书之——文件命名

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
IDesign C#编码规范(五)

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

4 Framework特别指导
Framework Specific Guidelines
4.1 数据访问
Data Access
1. 总是使用类型安全的数据集或者数据表。避免使用原始的ADO.NET。
Always use type-safe data sets or data tables . Avoid raw ADO.NET.
2. 访问数据库时总是使用事务。
Always use transactions when accessing a database.
a) 总是使用服务组件事务。
Always use Enterprise Services transactions.
b) 不要使用ADO.NET事务。
Do not use ADO.NET transactions.
3. 总是将事务隔离级别设置为序列的。
Always use transaction isolation level set to Serializable.
a) 使用其它隔离级别需要管理层决定。
Requires management decision to use anything else.
4. 不要使用服务器浏览器将数据库连接拖到Windows表单、ASP.NET表单或Web服务中。这样做耦合了界面层和数据层。
Do not use the Server Explorer to drop connections on windows forms, ASP.NET forms or web services. Doing so couples the presentation tier to the data tier.
5. 避免使用SQL Server验证。
Avoid SQL Server authentication.
a) 而是使用Windows验证。
Use Windows authentication instead.
6. 将访问SQL Server的组件以调用该组件客户端不同的身份运行。
Run components accessing SQL Server under separate identity from that of the calling client.
7. 总是在高层用类型安全的类包装存储过程。仅在那个类中调用存储过程。
Always wrap your stored procedures in a high level, type safe class. Only that class invokes the stored procedures.
8. 避免在存储过程中放任何逻辑。
Avoid putting any logic inside a stored procedure.
a) 如果存储过程中有IF,你可能犯了错误。
If there is an IF inside a stored procedure, you are doing something wrong.




相关文章

相关软件