A voir également:
- Visual studio 2008 vs sql server R2 2008
- Telecharger fl studio 20 pour pc gratuit complet - Télécharger - Édition & Montage
- Udp vs tcp - Guide
- Visual c++ 2019 - Guide
- Cybera server - Télécharger - Divers Réseau & Wi-Fi
- Visual paradigm - Télécharger - Gestion de données
6 réponses
Voila le code dans le projet executé en tant que administrateur:
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=RABEB-PC;Initial Catalog=vaccination;Integrated Security=True");
String cmdStr = "Select count(*)from authentification where username='" +TextBox1.Text+ "'";
SqlCommand Checkuser = new SqlCommand(cmdStr, con);
con.Open();
int temp = System.Convert.ToInt32(Checkuser.ExecuteScalar().ToString());
if(temp==1)
{
String cmdStr2= "Select Password from authentification where username='"+TextBox1.Text+"'";
SqlCommand pass=new SqlCommand(cmdStr2,con);
String password = pass.ExecuteScalar().ToString();
con.Close();
if(password==TextBox2.Text)
{
Session["New"]=TextBox1.Text;
Label1.Text="Hello...";
}
else
{
Label1.Visible=true;
Label1.Text="invalid password...";
}
}
else
{
Label1.Visible=true;
Label1.Text="invalid UserName...";
}
//et pour ce meme code l'autre projet s'execute avec succé.
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=RABEB-PC;Initial Catalog=vaccination;Integrated Security=True");
String cmdStr = "Select count(*)from authentification where username='" +TextBox1.Text+ "'";
SqlCommand Checkuser = new SqlCommand(cmdStr, con);
con.Open();
int temp = System.Convert.ToInt32(Checkuser.ExecuteScalar().ToString());
if(temp==1)
{
String cmdStr2= "Select Password from authentification where username='"+TextBox1.Text+"'";
SqlCommand pass=new SqlCommand(cmdStr2,con);
String password = pass.ExecuteScalar().ToString();
con.Close();
if(password==TextBox2.Text)
{
Session["New"]=TextBox1.Text;
Label1.Text="Hello...";
}
else
{
Label1.Visible=true;
Label1.Text="invalid password...";
}
}
else
{
Label1.Visible=true;
Label1.Text="invalid UserName...";
}
//et pour ce meme code l'autre projet s'execute avec succé.
parce que si le username et le password sont correctes alors lorsque je clique sur le bouton il m'affiche hello sinon invalid username.
je suis debutante en .net.
je suis debutante en .net.
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question