微软的SQLHelper类
1. using System;
2. using System.Data;
3. using System.Xml;
4. using System.Data.SqlClient;
5. using System.Collections;
6. namespace Book.DAL
7. {
8. /// <summary>
9. /// SqlServer数据访问帮助类
10. /// </summary>
11. public sealed class SqlHelper
12. {
13. #region 私有构造函数和方法
14. private SqlHelper() {}
15. /// <summary>
16. /// 将SqlParameter参数数组(参数值)分配给SqlCommand命令.
17. /// 这个方法将给任何一个参数分配DBNull.Value;
18. /// 该操作将阻止默认值的使用.
19. /// </summary>
20. /// <param name="command">命令名</param>
21. /// <param name="commandParameters">SqlParameters数组</param>
22. private static void AttachParameters(SqlCommand command, SqlParameter[] commandParameters)
23. {
24. if( command == null ) throw new ArgumentNullException( "command" );
25. if( commandParameters != null )
26. {
27. foreach (SqlParameter p in commandParameters)
28. {
29. if( p != null )
30. {
31. // 检查未分配值的输出参数,将其分配以DBNull.Value.
32. if ( ( p.Direction == ParameterDirection.InputOutput || p.Direction == ParameterDirection.Input ) &&
33. (p.Value == null))
34. {
35. p.Value = DBNull.Value;
36. }
37. command.Parameters.Add(p);
38. }
39. }
40. }
41. }
42.
微软SqlHelper类(中文版)中的方法及说明整理,帮助新手认识这个类文件 (后附SqlHelper类(中文版))_计算机软件及应用_IT/计算机_专业资料。微软SqlHelper类(中文版...
微软SqlHelper类中文注释和使用方法_IT/计算机_专业资料。微软 SqlHelper 类中文注释和使用方法整理:飞晏博客;网址:http://www.feiyan.info/416.html。 和微软...
微软SqlHelper中方法列表_理学_高等教育_教育专区。SqlHelper方法列表本文章主要介绍 SqlHelper 使用。 每个项目都要用到数据访问层,我做的也不例外,但是我把数据...
SqlHelper体验谈: 以下载自CEOCIO(MVP/CSDN_WEB开发版主)的Blog: 微软提供的Data Access Application Block中的SQLHelper类中封装了最常用的数据操作,各个使用者...
微软提供的数据访问组件SqlHelper_IT/计算机_专业资料。微软提供的数据访问组件SqlHelper数据访问组件是一组通用的访问数据库的代码,在所有项目中都可以用,一般不需要...
应用sqlhelper的例子_计算机软件及应用_IT/计算机_专业资料。应用SqlHelper例子(... 微软的SQLHelper类(含完... 43页 免费 SQLhelper 39页 免费 最全的SQL...
自己写的SqlHelper类_计算机软件及应用_IT/计算机_专业资料。方法重载,支持参数... SqlHelper类的方法 17页 免费 SQLHelper类 12页 免费 微软SqlHelper类中文...
中文解释的SqlHelper.cs类_计算机软件及应用_IT/计算机_专业资料。中文解释的 ... 微软的SQLHelper类(含完... 43页 7下载券 微软的SQLHelper类(含完... ...
SqlHelper类_计算机软件及应用_IT/计算机_专业资料。C# SqlHelper类... 微软SqlHelper类中文注释... 63页 1下载券 SQLHelper类 43页 免费 自己写...
热门文档