zoukankan      html  css  js  c++  java
  • out参数的用法

    int FFXPD = Govaze.SQLServerDAL.Factory.getCHINADADAL().d_YWZC_new_Sample_FHXPD

    (int.Parse(MainAID.Text), int.Parse(ItemTreeID.SelectedValue), ObjectType.Text, getUserName());

    public int d_YWZC_new_Sample_FHXPD(int MainAID, int TreeID, string Text1, string UserName)
    {
      int FFXPD;
      int rowsAffected = 0;
    SqlParameter[] parameters = new SqlParameter[]
    {
    new SqlParameter("@MainAID", SqlDbType.Int),
    new SqlParameter("@TreeID", SqlDbType.Int),
    new SqlParameter("@Text1", SqlDbType.NVarChar,1000),
    new SqlParameter("@UserName", SqlDbType.VarChar,50),
    new SqlParameter("@FFXPD", SqlDbType.Int)
    };
    parameters[0].Value = MainAID;
    parameters[1].Value = TreeID;
    parameters[2].Value = Text1;
    parameters[3].Value = UserName;
    parameters[4].Direction = ParameterDirection.Output;

    SQLHelper.RunProcedure("d_YWZC_new_Sample_FHXPD", parameters, out rowsAffected);
    FFXPD = parameters[4].Value != null && parameters[4].Value.ToString() != "" ? int.Parse(parameters[4].Value.ToString()) : 0;
    return FFXPD;
    }

    ALTER PROCEDURE [dbo].[d_YWZC_new_Sample_FHXPD] --符合性判定
    @MainAID INT,
    @TreeID INT,
    @Text1 Nvarchar(1000)=NULL,
    @UserName varchar(50),
    @FFXPD INT OUT

    AS
    begin

    declare @Text107 Nvarchar(100)
    SELECT @Text107=NodeName FROM tb_Tree_YWZC WHERE TreeID=@TreeID
    if @Text1='力学性能' or @Text1='热物性能' or @Text1='结构分析' or @Text1='无损检测'
    begin
    declare @ExitText107 nvarchar(50) --已经存在的项目
    select @ExitText107=Text107 from td_YWZC_Sample where MainAID=@MainAID and Text1=@Text1 and Creator=@UserName
    if @ExitText107 is null or @ExitText107='' or @ExitText107=@Text107
    begin
    select @FFXPD=1
    end
    else if @ExitText107 is not null and @ExitText107<>'' and @ExitText107<>@Text107
    begin
    select @FFXPD=0
    end
    end

    else if @Text1='化学分析' or @Text1='金相分析'
    begin
      select @FFXPD=1
    end

    END

  • 相关阅读:
    string subscript out of range
    基数树(radix tree)
    改进版的快速排序
    快速排序算法-C语言实现
    归并排序
    用数组名做函数参数(转)
    堆和栈的区别
    给指针malloc分配空间后就等于数组吗?
    codeblocks中添加-std=c99
    堆排序-C语言实现
  • 原文地址:https://www.cnblogs.com/sanshengshitouhua/p/14452094.html
Copyright © 2011-2022 走看看