相关疑难解决方法(0)

在ADO.NET中获取输出参数值

我的存储过程有一个输出参数:

@ID INT OUT
Run Code Online (Sandbox Code Playgroud)

如何使用ado.net检索此内容?

using (SqlConnection conn = new SqlConnection(...))
{
    SqlCommand cmd = new SqlCommand("sproc", conn);
    cmd.CommandType = CommandType.StoredProcedure;

    // add parameters

    conn.Open();

    // *** read output parameter here, how?
    conn.Close();
}
Run Code Online (Sandbox Code Playgroud)

.net c# ado.net

90
推荐指数
5
解决办法
19万
查看次数

标签 统计

.net ×1

ado.net ×1

c# ×1