Parameters.Add的问题???

vcinsect vcinsect 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
private SqlCommand CreateCommand(string procName, SqlParameter[] prams)
{
Open();
SqlCommand cmd = new SqlCommand(procName, cn);
cmd.CommandType = CommandType.StoredProcedure;
if (prams != null)
{
foreach (SqlParameter parameter in prams)
cmd.Parameters.Add(parameter);
}

cmd.Parameters.Add(
new SqlParameter("ReturnValue", SqlDbType.Int, 4,
ParameterDirection.ReturnValue, false, 0, 0,
string.Empty, DataRowVersion.Default, null));
return cmd;
}

我不懂这个函数中:
cmd.Parameters.Add(
new SqlParameter("ReturnValue", SqlDbType.Int, 4,
ParameterDirection.ReturnValue, false, 0, 0,
string.Empty, DataRowVersion.Default, null));
是什么意思~~ 为什么有怎么多参数呢~~ 为什么是SqlDbType.Int,如果是其他实践类型怎么办??
...全文
评论 2
收藏 已收藏
分享
返回顶部
vcinsect
.NET社区 62,271 成员 668,968 内容