salut,
j'ai une méthode d'authentification (d'ouvrir une session) dans un web service, j'ai essayé cette méthode en Windows Vista(laptop de ma copine), elle ça marche trés bien sans erreur et me donne comme résultat: "true"

et je l'ai essayé en Windows XP SP2( mon pc) elle me donne une erreur au niveau de la ligne public int authentifier(string user, string vv)

erreur:
'WS_authentification.authentifier(string, string)' : tous les chemins de code ne retournent pas nécessairement une valeur

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
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
....
[WebMethod]
    public int authentifier(string login, string mp)
    {
        System.Data.SqlClient.SqlConnection connexion;
        connexion = new System.Data.SqlClient.SqlConnection();
        string connectString = "Data Source=STANDARD;"
                                                   + "Initial Catalog=SejoursHOTEL;"
                                                   + "User ID=sa;"
                                                   + "Password=administrateur;";
        string strQuery = "select sa_Num_CLI from T_Client";
        connexion.ConnectionString = connectString;
        SqlCommand oCommand = new SqlCommand(strQuery, connexion);
        // Connexion à la base de données
        connexion.Open();
        SqlDataReader oReader = oCommand.ExecuteReader();
        //  bool returnBool = false;
        int a = 0;
        while (oReader.Read())
        {
            if ((oReader[11].ToString() == login) && (oReader[12].ToString() == mp))
            {
                Session["UserNum"] = oReader[0].ToString();
                // returnBool = true;
                a = 1;
            }
            oReader.Close();
            connexion.Close();
            //return returnBool;
            return a;
        }
    }
est ce qu'il ya quelqu'un qui peut m'aider, vraiment je suis bloquée , et j'ai besoin de l'authentification pour terminer mon application, merci