My function isn't returning anything - strReturn is empty:
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;
}
}
When I execute this stored proc using 'exec GetMerchantLocationZip (3333, 373773)' I get the correct zipcode in SQL. Why don't I get it in Visual Studio?
Create PROCEDURE [dbo].[GetMerchantLocationZip](
@MerchantID bigint,
@LoactionID bigint)
AS
Begin
Select Zip FROM Merchant_Location
where MerchantID=@MerchantID AND LocationID =@LoactionID
End
I am learning, so apologies if it's a obvious error. Thanks all!