hi,
its seems you are missing C.Id in your select statement as you are using C.Id in the where clause.
try this.
create proc Procedure
@ProductName varchar(50),
@CompanyName varchar(50)
as
begin
select P.ProductName,P.Category,P.Description,
P.Cost,P.Onsale,P.SalePrice,P.CreatedUserId,P.CreatedDateTime,
P.UpdatedUserId,P.UpdatedDateTime,C.CompanyName, C.Id
from CompanyProduct p inner join Company c on p.CompanyId= C.Id
where P.ProductName=@ProductName
or C.CompanyName=@CompanyName
end
hope this will help you..