I am calling a stored procedure (PS_StatistiqueEsc) via LINQ, and in the stored procedure i pass 3 parameters start,end and engin (see the code at bottom).
using (var escEnts = new escEntities()) {
var query = escEnts.PS_StatistiqueEsc(Convert.ToDateTime(start),
Convert.ToDateTime(end), engin).ToList();
}
so far so good.
my questions is how can i pass a 4th parameter as a list like (see the code at bottom) or an XML as a parameter:
For Example :
List<int> listToPassInSP = new List<int>();
list.Add(2);
list.Add(3);
list.Add(7);
using (var escEnts = new escEntities()) {
var query = escEnts.PS_StatistiqueEsc(Convert.ToDateTime(start), Convert.ToDateTime(end), engin, listToPassInSP).ToList();
}
Actually the stored procedure accept only 3 parameters ? I am going to changed change my sp which is going to accept a 4th parameter.
The actual SP signature is :
ALTER PROCEDURE [dbo].[PS_StatistiqueEsc]
@dateDebut datetime,
@dateFin datetime,
@EnginName varchar(250)
AS
But will be changed like this :
ALTER PROCEDURE [dbo].[PS_StatistiqueEsc]
@dateDebut datetime,
@dateFin datetime,
@EnginName varchar(250),
@listToPassInSP ???? (i don't know how to declare a variable like a list)
AS
Just want to pass a list to a SP and and the SP must accept a list. How can i do ?