资源简介
☆ 资料说明:☆
The Data Access Application Block is a .NET component that contains optimized data access code that will help you call stored procedures and issue SQL text commands against a SQL Server database;
☆ 文件清单:☆
Data Access Application Block for .NET V2.7z
☆ 相关网址:☆
Data Access Application Blo
代码片段和文件信息
// ===============================================================================
// Microsoft Data Access Application Block for .NET
// http://msdn.microsoft.com/library/en-us/dnbda/html/daab-rm.asp
//
// SQLHelper.cs
//
// This file contains the implementations of the SqlHelper and SqlHelperParameterCache
// classes.
//
// For more information see the Data Access Application Block Implementation Overview.
// ===============================================================================
// Release history
// VERSION DEscriptION
// 2.0 Added support for FillDataset UpdateDataset and “Param“ helper methods
//
// ===============================================================================
// Copyright (C) 2000-2001 Microsoft Corporation
// All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED “AS IS“ WITHOUT WARRANTY
// OF ANY KIND EITHER EXPRESSED OR IMPLIED INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
// FITNESS FOR A PARTICULAR PURPOSE.
// ==============================================================================
using System;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
using System.xml;
namespace Microsoft.ApplicationBlocks.Data
{
///
/// The SqlHelper class is intended to encapsulate high performance scalable best practices for
/// common uses of SqlClient
///
public sealed class SqlHelper
{
#region private utility methods & constructors
// Since this class provides only static methods make the default constructor private to prevent
// instances from being created with “new SqlHelper()“
private SqlHelper()
{
}
///
/// This method is used to attach array of SqlParameters to a SqlCommand.
/// This method will assign a value of DbNull to any parameter with a direction of
/// InputOutput and a value of null.
/// This behavior will prevent default values from being used but
/// this will be the less common case than an intended pure output parameter (derived as InputOutput)
/// where the user provided no input value.
///
/// The command to which the parameters will be added
/// An array of SqlParameters to be added to command
private static void AttachParameters(SqlCommand command SqlParameter[] commandParameters)
{
if (command == null) throw new ArgumentNullException(“command“);
if (commandParameters != null)
{
foreach (SqlParameter p in commandParameters)
{
if (p != null)
{
// Check for derived output value with no value assigned
相关资源
- 4秒100万条数据导入SQL数据库
- 通过SqlBulkCopy对象从Excel中批量导入到
- 政企单位在线培训考试系统 v3.0.zip
- 图片管理系统桃源相册管理
- lucene.net +盘古分词器
- 史上最好传智播客就业班.net培训教程
- sqlhelper新版含oracle、access、mysql
- IBatisNet + MySql
- 电子行业SFCS系统注册版
- 远达驾校管理系统 1.0.rar
- 城市公交查询系统(毕业设计).rar
- 城市交通查询系统 1.0.rar
- 教师教学资源库管理系统v6.2.1
- 物料管理系统
- 基于OPC和.net的数据采集系统软件Dem
- 假期联谊网站
- 耗材管控系统.7z
- mysql-connector-net-6.8.3
- 旅游管理系统 课程设计
- Log4Net获取异常信息并写入Mysql数据库
- 新闻发布系统源码带sql脚本
- 在线音乐网站源码
- 校友管理系统
- 学生自主学习平台源码(.NET)
- 固定资产管理系统源代码
- 物流管理系统-vs2008-sql2005
- Vs2015+SQL Server2014开发的一整套进销存
- 100万条数据导入SQL数据库仅用4秒
- .net+sql server考勤系统有数据库
- 人事管理系统附完整说明书
评论
共有 条评论