私は次のコードを持っています:
public static void executeStoredProcedure(SqlCommand sp)
{
SqlConnection conn = new SqlConnection();
conn.ConnectionString=Connection.getConnection();
conn.Open();
sp.CommandType = CommandType.StoredProcedure;
sp.Connection = conn;
sp.ExecuteNonQuery();
conn.Close();
}
このコードは、ストアド プロシージャを実行します。
しかし、私のストアドプロシージャは
Create procedure [dbo].[selectAllItems]
(@ItemCode varchar(50) )
as
begin
select * from Item where ItemCode = @ItemCode
end
行を返しますが、上記のC#コードでこの結果を取得する方法