【发布时间】:2011-04-10 07:01:48
【问题描述】:
我的函数没有返回任何东西 - strReturn 是空的:
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 MerchantID=@MerchantID AND LocationID =@LoactionID
End
我正在学习,如果这是一个明显的错误,请道歉。谢谢大家!
【问题讨论】:
-
很棒的伙计们!感谢大家的帮助! :)
标签: c# asp.net sql sql-server ado.net