【问题标题】:How can i have same parameter for input and output in stored procedure which is called? [duplicate]如何在被调用的存储过程中为输入和输出提供相同的参数? [复制]
【发布时间】:2014-12-19 13:33:45
【问题描述】:

T-SQL 部分

create PROCEDURE SPROC_GetTrail
    -- Add the parameters for the stored procedure here
      @AccountId INT ,
      @SchemePlanCode INT ,
      @Todate OUTPUT 

END 

c#部分

  db = DatabaseFactory.CreateDatabase("io");
                getCommissionReconMisCmd = db.GetStoredProcCommand("SPROC_GetTrail");
                db.AddINParameter(getCommissionReconMisCmd, "@Id", DbType.Int32, AId);--- 

这个应该作为参数和输出参数使用

【问题讨论】:

    标签: c# sql-server tsql


    【解决方案1】:

    您可以使用Database.AddParameter method。 第三种方法的参数是你的 sql 参数的方向。所以你可以使用InputOutput枚举值。

    【讨论】:

      猜你喜欢
      • 2015-09-27
      • 2023-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-19
      相关资源
      最近更新 更多