voila le code source du fichier login.aspx essaye de me trouver l'emplacement ou le nom de la bd:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace transmission
{
/// <summary>
/// Description résumée de login.
/// </summary>
public class login : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox txtPassword;
protected System.Web.UI.WebControls.Label LblPswd;
protected System.Web.UI.WebControls.TextBox TxtMatricule;
protected System.Web.UI.WebControls.Label Lblmatricule;
protected System.Web.UI.WebControls.Label lblMsg;
protected System.Web.UI.WebControls.ImageButton ImageButton1;
protected System.Web.UI.WebControls.Button btn_login;
protected System.Web.UI.WebControls.HyperLink HyperLink1;
protected System.Web.UI.WebControls.Image Image1;
protected System.Web.UI.WebControls.Label Label1;
private void Page_Load(object sender, System.EventArgs e)
{
}
#region Code généré par le Concepteur Web Form
override protected void OnInit(EventArgs e)
{
//
// CODEGEN : Cet appel est requis par le Concepteur Web Form ASP.NET.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
/// le contenu de cette méthode avec l'éditeur de code.
/// </summary>
private void InitializeComponent()
{
this.btn_login.Click += new System.EventHandler(this.btn_login_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btn_login_Click(object sender, System.EventArgs e)
{
SqlConnection connSQL = new SqlConnection();
//connSQL.ConnectionString = "Integrated Security=SSPI;Persist Security Info=False; Trusted_Connection=Yes; Initial Catalog=base_trans;Data Source=INES;Packet Size=4096;Workstation ID=INES;";
//connSQL.ConnectionString = "Integrated Security=SSPI;Persist Security Info=False; Trusted_Connection=Yes; Initial Catalog=base_trans;Data Source=dttpe005;Packet Size=4096;Workstation ID=dttpe005;";
connSQL.ConnectionString = "Integrated Security=SSPI;Persist Security Info=False; Trusted_Connection=Yes; Initial Catalog=base_trans;Data Source=dttpe005;Packet Size=4096;Workstation ID=dttpe005;UID=trans;PWD=trans";
try
{
connSQL.Open();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlCommand cmd = new SqlCommand("identification");
SqlParameter mat = new SqlParameter("@matricule", SqlDbType.Int);
SqlParameter pswd = new SqlParameter("@password", SqlDbType.VarChar);
cmd.Connection = connSQL;
cmd.CommandType = CommandType.StoredProcedure;
mat.Value = Convert.ToInt16(TxtMatricule.Text);
pswd.Value = txtPassword.Text;
cmd.Parameters.Add(mat);
cmd.Parameters.Add(pswd);
da.SelectCommand = cmd;
da.Fill(ds);
DataTable dt = new DataTable();
dt = ds.Tables[0];
if (dt.Rows.Count != 0)
{
Session["matricule"] = ds.Tables[0].Rows[0]["matricule"].ToString();
Session["Nom"] = ds.Tables[0].Rows[0]["nomPrenom"].ToString();
Session["fonction"] = ds.Tables[0].Rows[0]["fonction"].ToString();
Session["mail"] = ds.Tables[0].Rows[0]["mail"].ToString();
Session["tel"] = ds.Tables[0].Rows[0]["tel"].ToString();
/*if (ds.Tables[0].Rows[0]["matricule"].ToString() == "100" & ds.Tables[0].Rows[0]["password"].ToString() == "100")
Response.Redirect("MAP.aspx");
else*/
Response.Redirect("home.aspx");
}
else
{
TxtMatricule.Text = "";
txtPassword.Text = "";
lblMsg.Visible = true;
lblMsg.Text = "Erreur! Vérifiez votre matricule et votre mot de passe";
}
}
catch (Exception ex)
{
lblMsg.Visible = true;
lblMsg.Text = ex.Message;
}
finally
{
connSQL.Close();
TxtMatricule.Text = "";
txtPassword.Text = "";
}
}
}
}