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
/////////////***************debut code:***************//////////////
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]
publicint 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 = newSqlCommand(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();
//Session["UserPasswd"] = Passwd;
// returnBool = true;
a = 1;
}
oReader.Close();
connexion.Close();
//return returnBool;
return a;
}}
////////////////*************fin code****************//////////////
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
excusez moi si j'ai mal choisi le thème , il n'ya pas C# et web service en .NET
merci pour codes-sources