我遇到了一个返回行数的存储过程,但不确定如何在这里读取行数,
存储过程是:
CREATE PROCEDURE [dbo].[Document_Exists]
(
@Url varchar(255)
)
AS
SET NOCOUNT ON;
SELECT COUNT(*) AS Rows
FROM Document_Instances
WHERE Url = @Url
执行为
EXEC @return_value = [dbo].[Document_Exists]
@SourceSiteUrl = N'https://cc23.dev.com/portal'
SELECT 'Return Value' = @return_value
试图用这段代码阅读它
SqlCommand cmd1 = new SqlCommand("Document_Exists", conn);
cmd1.CommandType = CommandType.StoredProcedure;
cmd1.Parameters.Add(new SqlParameter("@Url", url));
SqlDataReader rdr1 = cmd.ExecuteReader();
while (rdr1.Read())
{
不知道下一步该做什么