bonjour a tous j'aimerais vous soumettre mon problème afin de recevoir un peu d'aide de votre part.
je voudrais faire un petit forum en asp.net c#
ce mini projet contient une page d'inscription; une page de connexion; et une dernière pour voir et ajouter les messages au forum.
j'ai fini ma page d'incription mais j'ai du mal a le connecté a la base de donnée ou plutot a inserer les nouveau inscrit dans la base de donnée via l'interface
voici le code de ma premier page
comment pourrais je la connecté a la base de donnée et que faire de plus dans le code du bouton envoie pour insertion dans la base de donnée.
<%@ Page Language="C#" %>
<%@ Register TagPrefix="wmx" Namespace="Microsoft.Matrix.Framework.Web.UI" Assembly="Microsoft.Matrix.Framework, Version=0.6.0.0, Culture=neutral, PublicKeyToken=6f763c9966660626" %>
<%@ import Namespace="System.Data.OleDb" %>
<script runat="server">
void Envoi(Object Sender, EventArgs E)
{
// A AJOUTER: 'strlen' 5 a 10 caracteres
if (zeUtilisateur.Text=="") zaErrUtilisateur.Text="Vous devez entrer un nom d'utilisateur dont la longueur varie entre 5 et 10 caractres";
else zaErrUtilisateur.Text="";
if (zePrenom.Text=="") zaErrPrenom.Text="Vous devez entrer votre prnom dont la longueur varie entre 5 et 10 caractres";
else zaErrPrenom.Text="";
if (zeMdp.Text=="") zaErrMdp.Text="Vous devez entrer un mot de passe";
else zaErrMdp.Text="";
if (zeConfMdp.Text=="") zaErrConfMdp.Text="Vous devez entrer une deuxime fois votre mot de passe";
else { if (zeConfMdp.Text!=zeMdp.Text) zaErrConfMdp.Text="Vos mots de passe ne concident pas";
else zaErrConfMdp.Text="";}
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<!-- Utilisateur --><asp:Label id="zaUtilisateur" runat="server" text="Utilisateur :"></asp:Label><asp:Label id="zaFacUtilisateur" runat="server" text="(*)"></asp:Label>
<asp:TextBox id="zeUtilisateur" runat="server"></asp:TextBox>
<asp:Label id="zaErrUtilisateur" runat="server" text=""></asp:Label>
<br clear="all" />
<!-- Nom --><asp:Label id="zaNom" runat="server" text="Nom :"></asp:Label><asp:Label id="zaFacNom" runat="server" text=""></asp:Label>
<asp:TextBox id="zeNom" runat="server"></asp:TextBox>
<asp:Label id="zaErrNom" runat="server" text=""></asp:Label>
<br clear="all" />
<!-- Prenom --><asp:Label id="zaPrenom" runat="server" text="Prenom :"></asp:Label><asp:Label id="zaFacPrenom" runat="server" text="(*)"></asp:Label>
<asp:TextBox id="zePrenom" runat="server"></asp:TextBox>
<asp:Label id="zaErrPrenom" runat="server" text=""></asp:Label>
<br clear="all" />
<!-- Email --><asp:Label id="zaEmail" runat="server" text="Email :"></asp:Label><asp:Label id="zaFacEmail" runat="server" text="(*)"></asp:Label>
<asp:TextBox id="zeEmail" runat="server"></asp:TextBox>
<asp:Label id="zaErrEmail" runat="server" text=""></asp:Label>
<br clear="all" />
<!-- Mot de passe --><asp:Label id="zaMdp" runat="server" text="Mot de passe :"></asp:Label><asp:Label id="zaFacMdp" runat="server" text="(*)"></asp:Label>
<asp:TextBox id="zeMdp" runat="server"></asp:TextBox>
<asp:Label id="zaErrMdp" runat="server" text=""></asp:Label>
<br clear="all" />
<!-- Confirmation mot de passe --><asp:Label id="zaConfMdp" runat="server" text="Confirmation Mot de passe :"></asp:Label><asp:Label id="zaFacConfMdp" runat="server" text="(*)"></asp:Label>
<asp:TextBox id="zeConfMdp" runat="server"></asp:TextBox>
<asp:Label id="zaErrConfMdp" runat="server" text=""></asp:Label>
<br clear="all" />
<asp:RadioButtonList id="rblMmeMlleMr" runat="server">
<asp:ListItem value="Madame" runat="server" />
<asp:ListItem value="Mademoiselle" runat="server" />
<asp:ListItem value="Monsieur" runat="server" />
</asp:RadioButtonList>
<br clear="all" />
<asp:ListBox id="lbPays" runat="server" SelectionMode="Single" Rows="2">
<asp:ListItem text="Belgique" runat="server" />
<asp:ListItem text="France" runat="server" />
<asp:ListItem text="Suisse" runat="server" />
</asp:ListBox>
<br clear="all" />
<asp:DropDownList id="ddlMoisNaissance" runat="server" SelectionMode="Single" Rows="10">
<asp:ListItem text="Janvier" runat="server" />
<asp:ListItem text="Fevrier" runat="server" />
<asp:ListItem text="Octobre" runat="server" />
<asp:ListItem text="Novembre" runat="server" />
<asp:ListItem text="Decembre" runat="server" />
</asp:DropDownList>
<asp:DropDownList id="ddljourNaissance" runat="server" SelectionMode="Single" Rows="9">
<asp:ListItem text="01" runat="server" />
<asp:ListItem text="02" runat="server" />
<asp:ListItem text="03" runat="server" />
<asp:ListItem text="04" runat="server" />
<asp:ListItem text="05" runat="server" />
<asp:ListItem text="06" runat="server" />
<asp:ListItem text="07" runat="server" />
<asp:ListItem text="08" runat="server" />
<asp:ListItem text="09" runat="server" />
<asp:ListItem text="10" runat="server" />
</asp:DropDownList>
<br clear="all" />
<asp:Image id="Image1" runat="server" alternatetext="Made with ASP.NET" imageurl="monica_bellucci.jpg"></asp:Image>
<br clear="all" />
<asp:CheckBox id="ccMailingList" runat="server" text="Sincrire a la mailing-list"></asp:CheckBox>
<br clear="all" />
<asp:Hyperlink id="HyperLink1" runat="server" Text="Le Sit" NavigateUrl="http:\\dotnet.developpez.com"></asp:Hyperlink>
<br clear="all" />
<asp:Calendar id="Calendar1" runat="server" VisibleDate="2003/12/11"></asp:Calendar>
<br clear="all" />
<br clear="all" />
<!-- Bouton d'envoi -->
<asp:Button id="bEnvoi" onclick="Envoi" runat="server" text="Envoi !"></asp:Button>
</form>
</body>
</html>
merci a tous pour votre aide