标签:style io os ar sp div art c on
}
/// <summary>
/// 运行存储过程,返回影响的行数
/// </summary>
/// <param name="storedProcName">存储过程名</param>
/// <param name="parameters">存储过程參数</param>
/// <param name="rowsAffected">影响的行数</param>
/// <param name="rowsAffected">返回output值</param>
/// <returns></returns>
public static int RunProcedure(string storedProcName, IDataParameter[] parameters, out int rowsAffected,out str)
{
using (SqlConnection connection = new SqlConnection(connectionString))
{
int result;
connection.Open();
SqlCommand command = BuildIntCommand(connection, storedProcName, parameters);
rowsAffected = command.ExecuteNonQuery();
result = (int)command.Parameters["ReturnValue"].Value;
str= (int)command.Parameters["@sReturn"].Value;
return result;
}
}
标签:style io os ar sp div art c on
原文地址:http://www.cnblogs.com/hrhguanli/p/4010989.html