Hello

j'ai une fonction sur un serveur SQL 2005 qui retourne le nombre de jours ouvrées entre 2 date
Cette fonction fonctionne nickel si execution dans SQL mais quand je veux récupèrer le nombre de jour a partir d'une fonction ASP.NET, j'ai toujours 0 en retour.
Si j'execute la requete du commandtext dans SQL serveur c'est ok

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
            strDateDeb = DateDeb.Year.ToString & DateDeb.Month.ToString.PadLeft(2, "0") & DateDeb.Day.ToString.PadLeft(2, "0")
            strDateFin = DateFin.Year.ToString & DateFin.Month.ToString.PadLeft(2, "0") & DateFin.Day.ToString.PadLeft(2, "0")
 
            cnn.Open()
            cmd.Connection = cnn
            cmd.CommandTimeout = 6000
            cmd.CommandType = CommandType.Text
            cmd.CommandText = "select dbo.ufn_JoursOuvres('" & strDateDeb & "','" & strDateFin & "'," & CodeSA & ") as t"
            adp.SelectCommand = cmd
            adp.Fill(dt)
 
            intJour = dt.Rows(0)("t")
 
            Return intJour
Avez vous une idée?