Accueil   |   Forums   |  Offres d'emplois   |  Contact    |   Mon compte   
vendredi 21 novembre 2008 Rechercher :
Déposez votre CV gratuitement sur touslesemplois
 
comparer les prix
» Logiciels
» Jeux vidéos
» Matériel Informatique


» ASP.NET
» ASP
» SQL
» PHP
» JAVASCRIPT
» XML
 


» ACTUALITÉ / DIVERS
» DROIT DE L'INTERNET
» INFOS VIRUS
» PATCHS MICROSOFT
» SÉCURITÉ
» BASES DE DONNÉES
» DOWNLOAD .NET
» LOGITHÈQUE
» SERVICES WEB
» Y SONT FOUS !
» .NET
» ASP
» ASP.NET
» JAVA
» PHP
» XML
» LANGAGE C#
» LANGAGE VB.NET
» UNIX / LINUX
» WINDOWS
» EVÈNEMENTS
» GASP
» MICROSOFT
 


Vous êtes ici : Forums > Langage SQL > est ce que quelqu'un peut m'aider

est ce que quelqu'un peut m'aider
je n'arrive pas a complier ma page (je n'arrive pas connecter ma page a ma base de donner ) j'ai deja crée ma base de donner

il y a des endrois ou il manque des choses et des endrois ou je me suis tromper si quelqu'un peut m'aider ca serai cool

voici ma page complete


<%@ Page Language="C#" Debug="true" %>
<%@ 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" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">

SqlConnection myConnection;

protected void Page_Load(Object Src, EventArgs E)
{
myConnection = new SqlConnection("server=seb\seb;database=bouffioulx;");

if (!IsPostBack)
BindGrid();
}

public void AddAuthor_Click(Object sender, EventArgs E)
{
Message.InnerHtml = "";

if (Page.IsValid)
{
String insertCmd = "insert into client (fnom, fprenom, fpseudo, fmotdepasse, fdatenaissance, frue, fnum, fboite, fcodepostal, fville, fpays, fmail) values (@nom, @prenom, @pseudo, @motdepasse, @datenaissance, @rue, @num, @boite, @codepostal, @ville, @pays, @mail)";
SqlCommand myCommand = new SqlCommand(insertCmd, myConnection);

myCommand.Parameters.Add(new SqlParameter("@nom", SqlDbType.VarChar, 50));
myCommand.Parameters["@nom"].Value = fnom.Text;

myCommand.Parameters.Add(new SqlParameter("@prenom", SqlDbType.VarChar, 50));
myCommand.Parameters["@prenom"].Value = fprenom.Text;

myCommand.Parameters.Add(new SqlParameter("@pseudo", SqlDbType.VarChar, 50));
myCommand.Parameters["@pseudo"].Value = fpseudo.Text;

myCommand.Parameters.Add(new SqlParameter("@motdepasse", SqlDbType.VarChar, 8));
myCommand.Parameters["@motdepasse"].Value = fmotdepasse.Text;

myCommand.Parameters.Add(new SqlParameter("@datenaissance", SqlDbType.datetime, 8));
myCommand.Parameters["@datenaissance"].Value = fdatenaissance.Text;

myCommand.Parameters.Add(new SqlParameter("@rue", SqlDbType.VarChar, 200));
myCommand.Parameters["@rue"].Value = frue.Text;

myCommand.Parameters.Add(new SqlParameter("@num", SqlDbType.Int, 4));
myCommand.Parameters["@num"].Value = fnum.Text;

myCommand.Parameters.Add(new SqlParameter("@boite", SqlDbType.Int,4));
myCommand.Parameters["@boite"].Value = fboite.Text;

myCommand.Parameters.Add(new SqlParameter("@codepostal", SqlDbType.VarChar,6));
myCommand.Parameters["@codepostal"].Value = fcodepostal.Text;

myCommand.Parameters.Add(new SqlParameter("@ville", SqlDbType.VarChar, 60));
myCommand.Parameters["@ville"].Value = fville.Text;

myCommand.Parameters.Add(new SqlParameter("@pays", SqlDbType.VarChar, 20));
myCommand.Parameters["@pays"].Value = fpays.Items;

myCommand.Parameters.Add(new SqlParameter("@mail", SqlDbType.VarChar, 200));
myCommand.Parameters["@mail"].Value = fmail.Text;

myConnection.Open();

try
{ myCommand.ExecuteNonQuery();

Message.InnerHtml = "<b>Enregistrement ajout</b><br>" + insertCmd + "<p>";
}

catch (SqlException e)
{
if (e.Number == 2627)
Message.InnerHtml = "ERREUR : Un enregistrement avec la mme cl primaire existe dj<p>";
else Message.InnerHtml = "ERREUR : Impossible d'ajouter l'enregistrement, vrifiez que les champs sont correctement remplis<p>";
Message.Style["color"] = "red";
}

myConnection.Close();
}

BindGrid();

}

public void BindGrid()
{ SqlDataAdapter myCommand = new SqlDataAdapter("select * from client", myConnection);

DataSet ds = new DataSet();
myCommand.Fill(ds, "client");
MyDataGrid.DataSource=ds.Tables["client"].DefaultView;
MyDataGrid.DataBind();
}

</script>
<html>
<head>
</head>
<body bgcolor="#198520" color="#ffffff" face="comic sans ms" font="font">
<form runat="server">
<p>
Nom&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:TextBox id="fnom" runat="server">taper votre Nom</asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<asp:Label id="Label2" runat="server" width="51px">Prnom</asp:Label>
<asp:TextBox id="fprenom" runat="server">Taper votre Prnom</asp:TextBox>
</p>
<p>
<asp:Label id="Label3" runat="server" width="63px">Pseudo</asp:Label>
<ASP:TextBox id="fpseudo" runat="server">taper votre pseudo</ASP:TextBox>
</p>
<p>
<asp:Label id="Label4" runat="server" width="113px">Mot de passe</asp:Label>&nbsp;<asp:TextBox id="fmotdepasse" runat="server"></asp:TextBox>
&nbsp; <asp:Label id="Label5" runat="server" width="170px">confirmation mot de passe</asp:Label>
<asp:TextBox id="TextBox5" runat="server"></asp:TextBox>
</p>
<p>
<asp:Label id="Label6" runat="server" width="116px">date de naissance</asp:Label>&nbsp;<asp:TextBox id="fdatenaissance" runat="server"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label id="Label7" runat="server" width="52px">age</asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:TextBox id="fage" runat="server"></asp:TextBox>
</p>
<p>
<asp:Label id="Label8" runat="server" width="51px">rue</asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:TextBox id="frue" runat="server"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Label id="Label9" runat="server" width="46px">n</asp:Label>&nbsp;
<asp:TextBox id="fnum" runat="server" Width="96px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Label id="Label10" runat="server" width="52px">Boite</asp:Label>
<asp:TextBox id="fboite" runat="server" Width="84px"></asp:TextBox>
</p>
<p>
<asp:Label id="Label11" runat="server" width="78px">code postal</asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;<asp:TextBox id="fcodepostal" runat="server"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Label id="Label12" runat="server" width="57px">ville</asp:Label>
<asp:TextBox id="fville" runat="server"></asp:TextBox>
</p>
<p>
<asp:Label id="Label13" runat="server" width="65px">Pays</asp:Label>
<asp:DropDownList id="fpays" runat="server">
<asp:ListItem Value="Allemagne">Allemagne</asp:ListItem>
<asp:ListItem Value="Angleterre">Angleterre</asp:ListItem>
<asp:ListItem Value="Belgique" Selected="True">Belgique</asp:ListItem>
<asp:ListItem Value="Espagne">Espagne</asp:ListItem>
<asp:ListItem Value="France">France</asp:ListItem>
<asp:ListItem Value="Luxemburg">Grand Duch&#233; du Luxemburg</asp:ListItem>
<asp:ListItem Value="Italie">Italie</asp:ListItem>
<asp:ListItem Value="Pays Bas">Pays Bas</asp:ListItem>
<asp:ListItem Value="Portugal">Portugal</asp:ListItem>
<asp:ListItem Value="Suisse">Suisse</asp:ListItem>
</asp:DropDownList>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Label id="Label1" runat="server" width="59px">Email</asp:Label>&nbsp;
&nbsp;<asp:TextBox id="fmail" runat="server"></asp:TextBox>
</p>
<p>
<asp:DataGrid id="MyDataGrid" runat="server"></asp:DataGrid>
<span id="Message" runat="server" enableviewstate="false">
<asp:Button id="Button1" style="Z-INDEX: 100; LEFT: 243px; POSITION: absolute; TOP: 372px" onclick="AddAuthor_Click" runat="server" Text="valider" OnLoad="Page_Load"></asp:Button>
</span>
</p>
</form>
</body>
</html>

:( :( :-( :-( :-( :(

merci :(

Message posté le 20/02/2005 par sebastien

Répondre à ce message
 


Project Hoshimi


A RETENIR CETTE SEMAINE
21/11/2008 - Microsoft Windows fête ses 23 ans !
Le célèbre système d'exploitation de Microsoft fête aujourd'hui son vingt-troisième anniversaire. C' ...
21/11/2008 - Pratiques fondamentales pour un développement logiciel sûr
L'article de Micheal Howard vient d'être traduit en français par Kader Yildirim ! Ce document synthé ...
21/11/2008 - Mise à jour de la méthode SDL pour éradiquer définitivement les Mécapoulets
Les Mécapoulets sont une menace perpétuelle pour les développeurs et les utilisateurs de leurs appli ...
20/11/2008 - A la découverte des tests d’interfaces graphiques avec Visual Studio 2010
Microsoft introduit dans sa version 2010 de Visual Studio les « Coded UI Tests », ou « Tests d’inter ...
20/11/2008 - PDC 2008 - Windows Azure vu par Grégory Renard
Grégory vous propose de découvrir en vidéo - et en 5 minutes - les annonces faites autour de Windows ...
20/11/2008 - Microsoft prépare une suite antivirus gratuite
L’éditeur abandonne Live One Care, sa solution payante, au profit de Morro, une suite antivirus grat ...
19/11/2008 - Comprendre le fonctionnement des Rules de WF
L'activité Policy va nous permettre de piloter nos workflows à partir de règles simples mais efficac ...
(c) 1999-2006 ASP MAGAZINE SARL
Partenaires : Codes sources c2i ASP-PHP
Hébergement serveurs dédiés Windows


Hit-Parade