I have a table FicheArticle
with a XML column ART_Fiche
.
I created a stored procedure to let me search in that XML column:
DECLARE @statement nvarchar(max) = N'SELECT ART_UniqueID FROM FicheArticle
CROSS APPLY ART_Fiche.nodes('''+@XPath+''') as TT(c)'
execute sp_executesql @statement
When I execute this on SQL Server I get 2 responses. First the list I want and the second a "return Value" (I suppose it's to say execute is good or not)
I call this one from my web application with Linq + Entity Framework like that
Dim a = LesDatas.GetArticleFiltred("//Product/ProductFeature[@CategoryFeature_ID=""6137"" and @Value=""DDR2""]")
I get an integer in return... I want the list, not the integer.
With all I read, I think it's on sp_executesql
I don't know how specify the output. All sample are on 1 integer (count(*), MAX ...) but don't find for return rows and I don't arrive to adapt others samples.
Thanks for your help
UPDATE 1
I try too
exec ('SELECT ART_UniqueID FROM SHOP_FicheArticle INNER JOIN SHOP_Article ON SHOP_FicheArticle.ART_IDIcecat = SHOP_Article.ART_IDIcecat CROSS APPLY ART_FicheIcecat.nodes('''+@XPath+''') as TT(c)')
And on vb side go on models explorer -> button Obtain informations of column but always in response : no column in return
Update 2
I try solution here to force Entity to have good return
IF 1 = 2 BEGIN
SELECT
cast(null as nvarchar(500)) as SHOP_FicheArticle
WHERE
1 = 2
END
Now Entity have the good return, but When I execute, it fail : not same type of return... Why I'm not so surprise... I see problem with EF and dynamic request :here I try to force in sql side : SET FMTONLY OFF But same problem
The data reader is incompatible with the specified 'ExtranetModel.GetArticleFiltred_Result'. A member of the type, 'SHOP_FicheArticle', does not have a corresponding column in the data reader with the same name.