0
我的web應用程序正在調用存儲過程,但未在ASP.net頁面中返回所需的結果。當我通過提供相同的值在sql server中執行存儲過程時,我得到了期望的結果。有什麼方法可以告訴網頁何時調用存儲過程的值?如何查找在最後一次運行時傳遞到存儲過程的值
注意:我正在使用sql server 2012 express。
Create PROCEDURE [dbo].[spvolview]
@Gender nvarchar(50),
@Age int,
@Country nvarchar(100)
AS
select
clinical_study.BRIEF_TITLE, clinical_study.OVERALL_STATUS, clinical_study.PHASE, clinical_study.STUDY_TYPE, clinical_study.GENDER, location_countries.COUNTRY, facilities.CITY
from clinical_study
inner join location_countries
ON clinical_study.NCT_ID=location_countries.NCT_ID
inner join facilities
on clinical_study.NCT_ID = facilities.NCT_ID
where (clinical_study.GENDER LIKE '%'[email protected]+'%' or clinical_study.GENDER like 'Both')
and clinical_study.HEALTHY_VOLUNTEERS <> 'No'
and clinical_study.OVERALL_STATUS like 'Rec%'
and @Age>(case when isnumeric(minimum_age)=1 then left(minimum_age,2) end)
and @Age<(case when isnumeric(MAXIMUM_AGE)=1 then left(MAXIMUM_AGE,2) end)
and location_countries.COUNTRY = @Country
您將需要某種形式的日誌添加到存儲過程,或(不記得,如果你可以用快速與否)使用SQL Server Profiler來查看發送到數據庫的語句。一個更簡單的替代方法是隻調試你的網頁並檢查在那裏傳遞了哪些參數。你打電話過程如何? – GarethD
將數據源添加到網格視圖中,我已將斷點添加到應用程序,它確實顯示作爲參數傳遞的值似乎很好,但理想情況下我想查看提供給數據庫中存儲過程的值本身。 –