我的功能並不返回任何東西存儲過程 - strReturn是空的:在SQL中沒有返回值
try
{
SqlParameter[] parameter = new SqlParameter[]
{
new SqlParameter("@MerchantID", MercahntID),
new SqlParameter("@LoactionID", LoactionID)
};
SqlHelper.ExecuteNonQuery(DbConnString, System.Data.CommandType.StoredProcedure, "GetMerchantLocationZip", parameter);
return strReturn;
}
catch (Exception ex)
{
LogError("Error Occurred When Retrieving Mercahnt Location Zip: MercahntID:" + MercahntID.ToString(), ex);
return strReturn;
}
}
當我使用執行此存儲過程「EXEC GetMerchantLocationZip(3333,373773)」我得到SQL中正確的郵政編碼。爲什麼我不能在Visual Studio中使用它?
Create PROCEDURE [dbo].[GetMerchantLocationZip](
@MerchantID bigint,
@LoactionID bigint)
AS
Begin
Select Zip FROM Merchant_Location
where [email protected] AND LocationID [email protected]
End
我在學習,所以很抱歉,如果這是一個明顯的錯誤。謝謝大家!
驚人的傢伙!感謝所有的幫助! :) – Ram 2010-09-09 14:25:55