Salut,
J'ai créé une procédure stockée qui me permet de récupérer des lignes dans une table unique.
Cette procédure stockée prend en paramètres :
mon mapping est correct :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 LTER PROCEDURE [dbo].[FilterLog] ( @DateFrom Date=null, @DateTo Date=null, @FilterField nvarchar(50)=null, @FilterValue nvarchar(MAX)=null, @DesiredPage int, @RowsPerPage int, @TotalRows int=null output, @TotalPages int=null output )
mes deux derniers paramètres sont bien en InOut
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 <Function Name="FilterLog" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> <Parameter Name="DateFrom" Type="date" Mode="In" /> <Parameter Name="DateTo" Type="date" Mode="In" /> <Parameter Name="FilterField" Type="nvarchar" Mode="In" /> <Parameter Name="FilterValue" Type="nvarchar(max)" Mode="In" /> <Parameter Name="DesiredPage" Type="int" Mode="In" /> <Parameter Name="RowsPerPage" Type="int" Mode="In" /> <Parameter Name="TotalRows" Type="int" Mode="InOut" /> <Parameter Name="TotalPages" Type="int" Mode="InOut" /> </Function>
après vérification la procédure stockée rempli bien les paramètres et renvoie bien les lignes sélectionnées mais les paramètres de sortie conservent leur valeur d'origine.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 System.Data.Objects.ObjectParameter paramTotalRows = new System.Data.Objects.ObjectParameter("TotalRows", pTotalRows); System.Data.Objects.ObjectParameter paramTotalPages = new System.Data.Objects.ObjectParameter("TotalPages", pTotalPages); var logs = from L in _context.FilterLog(pDateDe, pDateA, pFilterField, pfilterValue, pDesiredPage, pRowsPerPage, paramTotalRows, paramTotalPages) select L; pTotalRows = int.Parse(paramTotalRows.Value.ToString()); pTotalPages = int.Parse(paramTotalPages.Value.ToString());
Aurriez-vous déjà rencontré ce problème ? Une solution ?
D'avance merci
Laurent
Partager