`
sptgreen
  • 浏览: 45501 次
  • 性别: Icon_minigender_1
  • 来自: 荆门
社区版块
存档分类
最新评论

ASP.NET C# 调用存储过程 SQL SERVER 事务 数据库操作类

    博客分类:
  • .NET
阅读更多
我们现在写一个SQL SERVER的数据库简单的操作类。

包括事务,存储过程调用。

类文件如下:

using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace SpLib.db
{
    public class DBLib
    {
       
       // private SqlConnection con = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["connstr"]);
        private SqlConnection con = new SqlConnection("Server=SUNLEI;DataBase=SUNLEI;UID=sa;PWD=123456");

        //全局事务
        private SqlTransaction Tx = null;
        public DBLib()
        {

        }

        //手动开始事务
        public void BeginTransaction()
        {
            con.Open();
            Tx = con.BeginTransaction();
        }

        //手动提交事务
        public void CommitTransaction()
        {
            Tx.Commit();
            con.Close();
            Tx = null;
        }

        //手动回滚事务
        public void RollbackTransaction()
        {
            Tx.Rollback();
            con.Close();
            Tx = null;
           
        }

        //给存储过程的参数赋值
        public SqlCommand SetParams(SqlTypeBean[] bean, String ProcedureName)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.CommandText = ProcedureName;

          
            String para = "";
            for (int i = 0; i < bean.Length; i++)
            {
                para = para + bean[i].GetName() + "=" + bean[i].GetValueString();
                SqlParameter param = null;
                if (object.Equals(bean[i].GetClumType(), SqlDbType.VarChar))
                {
                    param = new SqlParameter(bean[i].GetName(), SqlDbType.VarChar, bean[i].GetClumLength());
                    if (bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = bean[i].GetValueString();
                    cmd.Parameters.Add(param);
                    continue;
                }
                else if (object.Equals(bean[i].GetClumType(), SqlDbType.Int))
                {
                    param = new SqlParameter(bean[i].GetName(), SqlDbType.Int, bean[i].GetClumLength());
                    if (bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = bean[i].GetValueLong();
                    cmd.Parameters.Add(param);
                    continue;

                }
                else if (object.Equals(bean[i].GetClumType(), SqlDbType.DateTime))
                {
                    param = new SqlParameter(bean[i].GetName(), SqlDbType.DateTime, bean[i].GetClumLength());
                    if (bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = DateTime.Parse(bean[i].GetValueString());
                    cmd.Parameters.Add(param);
                    continue;
                }
                else if (object.Equals(bean[i].GetClumType(), SqlDbType.Char))
                {
                    param = new SqlParameter(bean[i].GetName(), SqlDbType.Char, bean[i].GetClumLength());
                    if (bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = char.Parse(bean[i].GetValueString());
                    cmd.Parameters.Add(param);
                    continue;
                }
                else if (object.Equals(bean[i].GetClumType(), SqlDbType.Bit))
                {
                    param = new SqlParameter(bean[i].GetName(), SqlDbType.Bit, bean[i].GetClumLength());
                    if (bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = bean[i].GetValueString();
                    cmd.Parameters.Add(param);
                    continue;
                }

            }
            SpLib.busi.Log.WriteLog("执行存储过程为:" + ProcedureName + "\n参数为:"+para);
            cmd.Connection.Open();
            return cmd;

        }

        //给绑定变量的参数赋值
        public SqlCommand SetParamsSql(SqlTypeBean[] Bean, String Sql)
        {
            SqlCommand cmd = new SqlCommand(Sql);
            cmd.Connection = con;

            String para = "";
            for (int i = 0; i < Bean.Length; i++)
            {
                para = para + Bean[i].GetName() + "=" + Bean[i].GetValueString();
                SqlParameter param = null;
                if (object.Equals(Bean[i].GetClumType(), SqlDbType.VarChar))
                {
                    param = new SqlParameter(Bean[i].GetName(), SqlDbType.VarChar, Bean[i].GetClumLength());
                    if (Bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = Bean[i].GetValueString();
                    cmd.Parameters.Add(param);
                    continue;
                }
                else if (object.Equals(Bean[i].GetClumType(), SqlDbType.Int))
                {
                    param = new SqlParameter(Bean[i].GetName(), SqlDbType.Int, Bean[i].GetClumLength());
                    if (Bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = Bean[i].GetValueLong();
                    cmd.Parameters.Add(param);
                    continue;

                }
                else if (object.Equals(Bean[i].GetClumType(), SqlDbType.DateTime))
                {
                    param = new SqlParameter(Bean[i].GetName(), SqlDbType.DateTime, Bean[i].GetClumLength());
                    if (Bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = DateTime.Parse(Bean[i].GetValueString());
                    cmd.Parameters.Add(param);
                    continue;
                }
                else if (object.Equals(Bean[i].GetClumType(), SqlDbType.Char))
                {
                    param = new SqlParameter(Bean[i].GetName(), SqlDbType.Char, Bean[i].GetClumLength());
                    if (Bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = char.Parse(Bean[i].GetValueString());
                    cmd.Parameters.Add(param);
                    continue;
                }
                else if (object.Equals(Bean[i].GetClumType(), SqlDbType.Bit))
                {
                    param = new SqlParameter(Bean[i].GetName(), SqlDbType.Bit, Bean[i].GetClumLength());
                    if (Bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = Bean[i].GetValueString();
                    cmd.Parameters.Add(param);
                    continue;
                }

            }
            SpLib.busi.Log.WriteLog("执行存储过程为:" + Sql + "\n参数为:" + para);
            cmd.Connection.Open();
            return cmd;

        }

        //给存储过程的参数赋值,这方法需要在事务中使用
        public SqlCommand SetParamsTransactionProce(SqlTypeBean[] bean, String ProcedureName)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;
            cmd.Transaction = Tx;
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.CommandText = ProcedureName;

            String para = "";
            for (int i = 0; i < bean.Length; i++)
            {
                para = para + bean[i].GetName() + "=" + bean[i].GetValueString();
                SqlParameter param = null;
                if (object.Equals(bean[i].GetClumType(), SqlDbType.VarChar))
                {
                    param = new SqlParameter(bean[i].GetName(), SqlDbType.VarChar, bean[i].GetClumLength());
                    if (bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = bean[i].GetValueString();
                    cmd.Parameters.Add(param);
                    continue;
                }
                else if (object.Equals(bean[i].GetClumType(), SqlDbType.Int))
                {
                    param = new SqlParameter(bean[i].GetName(), SqlDbType.Int, bean[i].GetClumLength());
                    if (bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = bean[i].GetValueLong();
                    cmd.Parameters.Add(param);
                    continue;

                }
                else if (object.Equals(bean[i].GetClumType(), SqlDbType.DateTime))
                {
                    param = new SqlParameter(bean[i].GetName(), SqlDbType.DateTime, bean[i].GetClumLength());
                    if (bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = DateTime.Parse(bean[i].GetValueString());
                    cmd.Parameters.Add(param);
                    continue;
                }
                else if (object.Equals(bean[i].GetClumType(), SqlDbType.Char))
                {
                    param = new SqlParameter(bean[i].GetName(), SqlDbType.Char, bean[i].GetClumLength());
                    if (bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = char.Parse(bean[i].GetValueString());
                    cmd.Parameters.Add(param);
                    continue;
                }
                else if (object.Equals(bean[i].GetClumType(), SqlDbType.Bit))
                {
                    param = new SqlParameter(bean[i].GetName(), SqlDbType.Bit, bean[i].GetClumLength());
                    if (bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = bean[i].GetValueString();
                    cmd.Parameters.Add(param);
                    continue;
                }

            }
            SpLib.busi.Log.WriteLog("执行存储过程为:" + ProcedureName + "\n参数为:" + para);
            return cmd;

        }

        //给绑定变量赋值,此方法需要事务控制
        public SqlCommand SetParamsTransactionSql(SqlTypeBean[] Bean, String Sql)
        {
            SqlCommand cmd = new SqlCommand(Sql);
            cmd.Connection = con;
            cmd.Transaction = Tx;

            String para = "";
            for (int i = 0; i < Bean.Length; i++)
            {
                para = para + Bean[i].GetName() + "=" + Bean[i].GetValueString();
                SqlParameter param = null;
                if (object.Equals(Bean[i].GetClumType(), SqlDbType.VarChar))
                {
                    param = new SqlParameter(Bean[i].GetName(), SqlDbType.VarChar, Bean[i].GetClumLength());
                    if (Bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = Bean[i].GetValueString();
                    cmd.Parameters.Add(param);
                    continue;
                }
                else if (object.Equals(Bean[i].GetClumType(), SqlDbType.Int))
                {
                    param = new SqlParameter(Bean[i].GetName(), SqlDbType.Int, Bean[i].GetClumLength());
                    if (Bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = Bean[i].GetValueLong();
                    cmd.Parameters.Add(param);
                    continue;

                }
                else if (object.Equals(Bean[i].GetClumType(), SqlDbType.DateTime))
                {
                    param = new SqlParameter(Bean[i].GetName(), SqlDbType.DateTime, Bean[i].GetClumLength());
                    if (Bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = DateTime.Parse(Bean[i].GetValueString());
                    cmd.Parameters.Add(param);
                    continue;
                }
                else if (object.Equals(Bean[i].GetClumType(), SqlDbType.Char))
                {
                    param = new SqlParameter(Bean[i].GetName(), SqlDbType.Char, Bean[i].GetClumLength());
                    if (Bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = char.Parse(Bean[i].GetValueString());
                    cmd.Parameters.Add(param);
                    continue;
                }
                else if (object.Equals(Bean[i].GetClumType(), SqlDbType.Bit))
                {
                    param = new SqlParameter(Bean[i].GetName(), SqlDbType.Bit, Bean[i].GetClumLength());
                    if (Bean[i].GetIsOutPut())
                    {
                        param.Direction = ParameterDirection.Output;
                    }
                    param.Value = Bean[i].GetValueString();
                    cmd.Parameters.Add(param);
                    continue;
                }

            }
            SpLib.busi.Log.WriteLog("执行存储过程为:" + Sql + "\n参数为:" + para);
            return cmd;

        }

        //执行reader
        public SqlDataReader GetReader(String Sql, SqlTypeBean[] Bean)
        {
            SqlCommand command = SetParamsSql(Bean, Sql);

            return command.ExecuteReader();
        }

        //执行reader,需要在事务中使用。
        public SqlDataReader GetTransactionReader(String Sql, SqlTypeBean[] Bean)
        {
            SqlCommand command = SetParamsTransactionSql(Bean, Sql);

            return command.ExecuteReader();
        }

        //执行普通的sql
        public bool ExecSql(String Sql, SqlTypeBean[] Bean)
        {
            SqlCommand command = SetParamsSql(Bean, Sql);
            command.ExecuteNonQuery();
            command.Connection.Close();
            return true;
        }

        //执行事务控制的sql
        public bool ExecTransactionSql(String Sql, SqlTypeBean[] Bean)
        {
            SqlCommand command = SetParamsTransactionSql(Bean, Sql);
            command.ExecuteNonQuery();
            return true;
        }

        //取得记录的第一行第一列的值
        public String GetTransactionOneString(String Sql, SqlTypeBean[] Bean)
        {
            SqlCommand command = SetParamsTransactionSql(Bean, Sql);
            String result = command.ExecuteScalar().ToString();
            return result;
        }

        //取得记录的第一行第一列的值
        public String GetOneString(String Sql, SqlTypeBean[] Bean)
        {
            SqlCommand command = SetParamsSql(Bean, Sql);
            String result = command.ExecuteScalar().ToString();
            command.Connection.Close();
            command.Dispose();
            return result;
        }

        //取得DataSet
        public DataSet GetDataSet(String Sql, SqlTypeBean[] Bean)
        {
            SqlCommand command = SetParamsSql(Bean, Sql);
            command.Connection.Open();
            SqlDataAdapter SqlAdapter = new SqlDataAdapter(command);
            DataSet ds = new DataSet();
            SqlAdapter.Fill(ds, "");
            return ds;
        }
    }
}

上面这个类包括常用的操作数据库的方法,下面我们来写几个test用例

public class UnitTest1
    {
        public UnitTest1()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        [TestMethod]

       //这里演示怎么调用事务,用绑定变量。
        public void TestMethod1()
        {
            DBLib lib = new DBLib();              
            try
            {
                lib.BeginTransaction();//要使用事务,这里必须要先BeginTransaction(),下面执行的方法都要调用带Transaction的方法。
                String sql = "INSERT INTO testtable VALUES(@tid,@text)";
                SqlTypeBean[] bean = new SqlTypeBean[2];
                bean[0] = new SqlTypeBean(false, "@tid", "18", 4, SqlDbType.Int);
                bean[1] = new SqlTypeBean(false, "@text", "good", 50, SqlDbType.VarChar);
                lib.ExecTransactionSql(sql, bean);
                System.Console.WriteLine("ok!");
                sql = "INSERT INTO testtable VALUES(@tid,@text)";

                bean[0] = new SqlTypeBean(false, "@tid", "17", 4, SqlDbType.Int);
                bean[1] = new SqlTypeBean(false, "@text", "good", 50, SqlDbType.VarChar);
                lib.ExecTransactionSql(sql, bean);
                System.Console.WriteLine("ok!");

                lib.CommitTransaction();
            }
            catch (Exception e)
            {
                lib.RollbackTransaction();
                throw e;
            }
        }
        [TestMethod]

       //这里普通的调用
        public void TestMethod2()
        {
            DBLib lib = new DBLib();
            String sql = "INSERT INTO testtable VALUES(@tid,@text)";
            SqlTypeBean[] bean = new SqlTypeBean[2];
            bean[0] = new SqlTypeBean(false, "@tid", "7", 4, SqlDbType.Int);
            bean[1] = new SqlTypeBean(false, "@text", "good", 50, SqlDbType.VarChar);
            lib.ExecSql(sql, bean);
        }

        [TestMethod]

       //这里是带返回值的存储
        public void TestMethod3()
        {
            DBLib lib = new DBLib();
            SqlTypeBean[] bean = new SqlTypeBean[2];
            bean[0] = new SqlTypeBean(true, "@COUNT", "7", 4, SqlDbType.Int);
            bean[1] = new SqlTypeBean(false, "@TEXT", "good", 50, SqlDbType.VarChar);
            SqlCommand cmd = lib.SetParams(bean,"GETCOUNT");
            cmd.ExecuteNonQuery();
            String result = cmd.Parameters["@COUNT"].Value.ToString();
            String result1 = cmd.Parameters["@COUNT"].Value.ToString();
            cmd.Connection.Close();
        }
    }


存储存储过程变量的bean

using System;
using System.Collections.Generic;
using System.Text;

namespace SpLib.db
{
    //本类用于存放变量类型
    public class SqlTypeBean
    {
        //这里设定变量是输入变量还是输出变量。默认是输入变量
        private bool IsOutPut = false;      
        //这里存放字段变量的名称
        private String Name;
        //这里存放字段变量的值
        private String Value;
        //这里存放字段的长度
        private int ClumLength;
        //这里存放字段的类型
        private object ClumType;
   

        public SqlTypeBean(bool IsOutPut, String Name, String Value, int ClumLength, object ClumType)
        {
            this.IsOutPut = IsOutPut;
            this.Name = Name;
            this.Value = Value;
            this.ClumLength = ClumLength;
            this.ClumType = ClumType;
           
        }

        public SqlTypeBean( String Name, String Value, int ClumLength, object ClumType)
        {
            this.IsOutPut = false;
            this.Name = Name;
            this.Value = Value;
            this.ClumLength = ClumLength;
            this.ClumType = ClumType;

        }       

        public bool GetIsOutPut()
        {
            return IsOutPut;
        }

        public String GetName()
        {
            return Name;
        }

        public object GetClumType()
        {
            return ClumType;
        }

        public String GetValueString()
        {
            return Value;
        }

        public long GetValueLong()
        {
            return long.Parse(Value);
        }

        public bool GetValueBool()
        {
            return bool.Parse(Value);
        }

        public int GetClumLength()
        {
            return ClumLength;
        }

    }
}

原创文章,转载请标明出处http://blog.csdn.net/keyboardsun

作者 keyboardsun
分享到:
评论

相关推荐

    c# asp.net实现sql server数据库备份

    总之,使用C#和ASP.NET实现SQL Server数据库备份,主要涉及SMO库的使用,通过编写代码来配置备份类型、设备和选项,然后调用SqlBackup方法执行备份。在实际应用中,还需要考虑错误处理、日志记录、备份策略规划等...

    asp.net(C#)sql server数据库ado.net操作类SqlServerHelper

    在ASP.NET(C#)开发中,SQL Server数据库的交互是一个重要的环节。ADO.NET是一个.NET框架提供的数据访问技术,它提供了与各种数据库(包括SQL Server)的直接通信能力。本话题将详细探讨如何使用ADO.NET中的类`...

    C#-SQLServer数据库操作类技术手册

    《C#-SQLServer数据库操作类技术手册》是针对C#编程语言与SQL Server数据库集成应用的专业指南,旨在帮助开发者熟练掌握如何在C#环境中进行高效、稳定的数据库操作。手册内容涵盖C#中的ADO.NET框架、数据库连接、SQL...

    .Net Core2.1 使用SqlSugar对SqlServer数据库操作

    在.NET Core 2.1开发环境中,SqlSugar是一个流行的ORM(对象关系映射)框架,它简化了与SQL Server数据库的交互。SqlSugar提供了一种高效、轻量级且易于使用的解决方案,使得开发者无需编写大量的SQL语句,就能实现...

    C# ASP.NET 模块 - 数据库备份与恢复模块

    例如,你可以创建一个存储过程来执行备份,并在ASP.NET中调用这个存储过程,或者直接在C#代码中编写SQL语句进行备份。 接下来,数据库的分离和附加也是数据库管理的重要环节。分离数据库可以解除服务器对特定数据库...

    ASP.NET绑定sql数据库采用echarts显示数据图表(实现了柱状图和饼图).zip

    通过这个项目,我们可以学习到如何在ASP.NET中连接和操作SQL数据库,如何封装数据处理逻辑到独立的类文件中,以及如何利用ECharts将数据转化为直观的图表。这涉及到的知识点包括: 1. ASP.NET Web Forms:理解页面...

    Asp.net(c#)数据库操作类

    根据给定的信息,本文将详细解析“ASP.NET (C#)数据库操作类”的核心知识点,包括如何连接数据库、执行查询、更新、删除以及插入数据等关键功能。 ### ASP.NET (C#) 数据库操作类概览 #### 一、基础知识简介 在 ...

    asp.net_C#调用存储过程

    本文将深入探讨如何在ASP.NET环境中使用C#语言来调用SQL Server中的存储过程,包括其基本原理、实现步骤以及一些高级应用。 ### 存储过程的基本概念 存储过程是一种预编译的SQL代码块,存储于数据库中,可以接受...

    使用存储过程备份数据库 c# asp.net

    本文将深入探讨如何在C# ASP.NET环境中利用存储过程来实现数据库的备份操作。首先,让我们理解存储过程的概念,它是预编译的SQL语句集合,可以视为数据库中的可重用函数,提供性能优化和代码复用的优势。 一、存储...

    网上书店 asp.net 源代码与sql数据库

    网上书店的ASP.NET源代码与SQL数据库项目是一个典型的Web应用程序开发实例,主要涉及的技术栈包括ASP.NET、C#以及SQL Server。在这个项目中,开发者利用ASP.NET作为Web应用框架,C#作为后端编程语言,而SQL Server则...

    ASP.NET连接sql2008数据库

    在本项目中,我们将深入探讨如何利用ASP.NET连接SQL Server 2008数据库,并通过SqlConnection对象实现这一目标。 首先,为了连接SQL Server 2008数据库,我们需要创建一个SqlConnection对象。SqlConnection是.NET ...

    C#(VB.net)数据库访问操作类库

    数据库操作类: 支持 SQLServer mysql sqlite Sybase Oracle等DB 数据库操作类 包括执行SQL或者存储过程,返回DataSet、DataTable等功能 完全支持存储过程和参数调用 javascriptClassLibrary 包括一些JavaScript 类...

    ASP.NET和C#数据库操作源代码

    4. **SQL查询与存储过程**:源代码可能包含直接的SQL查询语句,如SELECT、INSERT、UPDATE和DELETE,或者调用数据库中的存储过程来执行更复杂的逻辑。 5. **ASP.NET Web Forms和MVC**:这两种是ASP.NET的主要开发...

    asp.net C#数据库访问公共类

    本文将深入探讨如何使用C#编写一个数据库访问公共类,以实现对SQL Server、Access和Oracle等不同数据库的通用操作。 首先,我们要创建一个数据库访问的基类,这个类通常包含连接数据库的基本方法,如打开、关闭连接...

    C# ASP.NET SQL数据库编程辅助类(含源码)

    这个资源包提供了C#编程的辅助类,旨在简化ASP.NET应用程序中与SQL数据库的交互。接下来,我们将深入探讨这些知识点。 首先,让我们关注"C# ASP.NET SQL数据库编程"。ASP.NET是由微软开发的一个用于构建Web应用程序...

    博客系统源代码C#《ASP.NET 2.0 + SQL Server 2005数据库开发与实例》

    《ASP.NET 2.0 + SQL Server 2005数据库开发与实例》是一本深入讲解如何使用ASP.NET 2.0和SQL Server 2005进行Web应用开发的专业书籍,尤其关注于构建博客系统。这个压缩包包含了该书中的实际源代码,帮助读者在实践...

    asp.net调用输出参数存储过程

    在 ASP.NET 中,我们通常使用 SqlConnection 类连接到 SQL Server 数据库,SqlCommand 类用于执行 SQL 命令或存储过程,而 SqlParameter 类则用来处理参数,包括输入参数、输出参数和输入/输出参数。 以下是调用带...

    ASP.NET数据库入门经典--C#编程篇1.rar

    本压缩包文件"ASP.NET数据库入门经典--C#编程篇1.rar"显然是一个关于学习ASP.NET数据库交互的教程资料,可能包含了书签、章节内容等资源,例如bookinfo.dat可能是书籍元数据,pdg文件通常是电子书的页面图像。...

    C#连接sql server 2005的存储过程例子大全.rar

    总之,这个压缩包提供了从C#应用程序调用SQL Server 2005存储过程的全面实例,涵盖了数据库连接、参数传递、结果处理等多个关键步骤,对于学习和掌握这一技能具有很高的参考价值。开发者可以通过这些示例,深入理解...

Global site tag (gtag.js) - Google Analytics