Visual studio 2008 vs sql server R2 2008
Fermé
rourou11
Messages postés
28
Date d'inscription
vendredi 29 juillet 2011
Statut
Membre
Dernière intervention
28 mai 2012
-
29 avril 2012 à 18:41
rourou11 Messages postés 28 Date d'inscription vendredi 29 juillet 2011 Statut Membre Dernière intervention 28 mai 2012 - 25 mai 2012 à 15:34
rourou11 Messages postés 28 Date d'inscription vendredi 29 juillet 2011 Statut Membre Dernière intervention 28 mai 2012 - 25 mai 2012 à 15:34
A voir également:
- Visual studio 2008 vs sql server R2 2008
- Visual studio 2008 - Télécharger - Langages
- Microsoft visual c++ runtime - Guide
- Visual studio 2017 - Télécharger - Langages
- Fl studio - Télécharger - Édition & Montage
- Visual paradigm - Télécharger - Gestion de données
6 réponses
rourou11
Messages postés
28
Date d'inscription
vendredi 29 juillet 2011
Statut
Membre
Dernière intervention
28 mai 2012
1
1 mai 2012 à 14:04
1 mai 2012 à 14:04
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é.
bouchrot
Messages postés
352
Date d'inscription
mercredi 12 octobre 2011
Statut
Membre
Dernière intervention
2 janvier 2023
6
30 avril 2012 à 01:11
30 avril 2012 à 01:11
qu'est ce que tu fait comme code
bouchrot
Messages postés
352
Date d'inscription
mercredi 12 octobre 2011
Statut
Membre
Dernière intervention
2 janvier 2023
6
1 mai 2012 à 19:36
1 mai 2012 à 19:36
d'abord pourquoi tu as met la connexion dans un bouton ,
et ou est le commandreader
et ou est le commandreader
rourou11
Messages postés
28
Date d'inscription
vendredi 29 juillet 2011
Statut
Membre
Dernière intervention
28 mai 2012
1
2 mai 2012 à 00:46
2 mai 2012 à 00:46
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
bouchrot
Messages postés
352
Date d'inscription
mercredi 12 octobre 2011
Statut
Membre
Dernière intervention
2 janvier 2023
6
4 mai 2012 à 22:12
4 mai 2012 à 22:12
je ne vois aucun teste de connexion
qu'est ce que tu veux faire
qu'est ce que tu veux faire
rourou11
Messages postés
28
Date d'inscription
vendredi 29 juillet 2011
Statut
Membre
Dernière intervention
28 mai 2012
1
25 mai 2012 à 15:34
25 mai 2012 à 15:34
dsl pour retard et merci pour votre aide.
le probleme c'est avec le serveur IIS. qaund le projet configuré avec le serveur il ne connecte pas a la base alors que le test de connexion marche avec succés mais si le projet executé sans la configuration de serveur je paux acceder a la base.
le probleme c'est avec le serveur IIS. qaund le projet configuré avec le serveur il ne connecte pas a la base alors que le test de connexion marche avec succés mais si le projet executé sans la configuration de serveur je paux acceder a la base.