PROBLEME DE MISE A JOUR AVEC FORMVIEW

simo5266 Messages postés 13 Date d'inscription vendredi 28 octobre 2005 Statut Membre Dernière intervention 5 juillet 2008 - 11 mars 2008 à 21:52
simo5266 Messages postés 13 Date d'inscription vendredi 28 octobre 2005 Statut Membre Dernière intervention 5 juillet 2008 - 12 mars 2008 à 00:19
Bonsoir tt le monde,


Je développe avec VS.NET 2005 une application WEB et j'ai un probleme de mise a jour(modification ou bien la suppression) avec le controle FORMVIEW c'est quand j'utilise la table liste_personnel mais quad j'utilise autres aucun probleme c'est vraiment bizzard
voila le code :


<%@
Page
Language="C#"
AutoEventWireup="true"
CodeFile="administration.aspx.cs"
Inherits="administration" %>



<!



DOCTYPE



html



PUBLIC



"-//W3C//DTD XHTML 1.0 Transitional//EN"



"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><


html



xmlns
="http://www.w3.org/1999/xhtml"



><


head



runat
="server">






<
title
>
DGP : ADMINISTRATION

</
title
></


head
><


body
>






<
form



id
="form1"



runat
="server">






<
div
><
center
>






<
asp
:
Label



ID
="Label1"



runat
="server"



Font-Bold
="True"



Font-Italic
="True"



Font-Size
="XX-Large"






Font-Strikeout
="False"



Font-Underline
="True"



ForeColor
="BurlyWood"



Text
="ADMINISTRATION"></
asp
:
Label
>
&nbsp;
</
center
>






<
center
>






&nbsp;
</
center
>






<
center
>






&nbsp;
</
center
>






<
center
>






&nbsp;
</
center
>






<
center
>






&nbsp;
</
center
>






<
center
>






&nbsp;






<
asp
:
Label



ID
="Label3"



runat
="server"



Text
="PAR NOM :"



Font-Bold
="True"



ForeColor
="Peru"



Width
="103px"></
asp
:
Label
>






<
asp
:
TextBox



ID
="TextBox2"



runat
="server"></
asp
:
TextBox
>






<
asp
:
Button



ID
="Button1"



runat
="server"



OnClick
="Button1_Click"



Text
="Search"



/></
center
>






<
center
>






&nbsp;
</
center
>






<
center
>






&nbsp;



&nbsp;&nbsp;
</
center
>






<
center
>






&nbsp;



&nbsp;



&nbsp;



&nbsp;&nbsp;
<
asp
:
FormView



ID
="FormView1"



runat
="server"



DataKeyNames
="MLE_PPR"






DataSourceID
="SqlDataSource1"



BackColor
="#DEBA84"



BorderColor
="#DEBA84"



BorderStyle
="None"



BorderWidth
="1px"



CellPadding
="3"



CellSpacing
="2"



GridLines
="Both"



HorizontalAlign
="Center"



Width
="489px"



Font-Bold
="True"



Font-Italic
="False">






<
EditItemTemplate
>

MLE_PPR:







<
asp
:
Label



ID
="MLE_PPRLabel1"



runat
="server"



Text
='
<%# Eval("MLE_PPR") %>

'></
asp
:
Label
><
br



/>

NOM_ PRENOM:







<
asp
:
TextBox



ID
="NOM__PRENOMTextBox"



runat
="server"



Text
='
<%# Bind("[NOM_ PRENOM]") %>

'>






</
asp
:
TextBox
><
br



/>

CIN:







<
asp
:
TextBox



ID
="CINTextBox"



runat
="server"



Text
='
<%# Bind("CIN") %>

'>






</
asp
:
TextBox
><
br



/>











NAISSANCE:


<
asp
:
TextBox



ID
="NAISSANCETextBox"



runat
="server"



Text
='
<%# Bind("NAISSANCE") %>

'>






</
asp
:
TextBox
><
br



/>

AFFECTATION:







<
asp
:
TextBox



ID
="AFFECTATIONTextBox"



runat
="server"



Text
='
<%# Bind("AFFECTATION") %>

'>






</
asp
:
TextBox
><
br



/>

ECHELLE:







<
asp
:
TextBox



ID
="ECHELLETextBox"



runat
="server"



Text
='
<%# Bind("ECHELLE") %>

'>






</
asp
:
TextBox
><
br



/>

ECHELON:







<
asp
:
TextBox



ID
="ECHELONTextBox"



runat
="server"



Text
='
<%# Bind("ECHELON") %>

'>






</
asp
:
TextBox
><
br



/>

CATEGORIE:







<
asp
:
TextBox



ID
="CATEGORIETextBox"



runat
="server"



Text
='
<%# Bind("CATEGORIE") %>

'>






</
asp
:
TextBox
><
br



/>

FONCTION:







<
asp
:
TextBox



ID
="FONCTIONTextBox"



runat
="server"



Text
='
<%# Bind("FONCTION") %>

'>






</
asp
:
TextBox
><
br



/>

ANCADMIN:







<
asp
:
TextBox



ID
="ANCADMINTextBox"



runat
="server"



Text
='
<%# Bind("ANCADMIN") %>

'>






</
asp
:
TextBox
><
br



/>

N_AFFIL-CRM:







<
asp
:
TextBox



ID
="N_AFFIL_CRMTextBox"



runat
="server"



Text
='
<%# Bind("[N_AFFIL-CRM]") %>

'>






</
asp
:
TextBox
><
br



/>






<
asp
:
LinkButton



ID
="UpdateButton"



runat
="server"



CausesValidation
="True"



CommandName
="Update"






Text
="Update">






</
asp
:
LinkButton
>






<
asp
:
LinkButton



ID
="UpdateCancelButton"



runat
="server"



CausesValidation
="False"



CommandName
="Cancel"






Text
="Cancel">






</
asp
:
LinkButton
>






</
EditItemTemplate
>






<
InsertItemTemplate
>

MLE_PPR:







<
asp
:
TextBox



ID
="MLE_PPRTextBox"



runat
="server"



Text
='
<%# Bind("MLE_PPR") %>

'>






</
asp
:
TextBox
><
br



/>

NOM_ PRENOM:







<
asp
:
TextBox



ID
="NOM__PRENOMTextBox"



runat
="server"



Text
='
<%# Bind("[NOM_ PRENOM]") %>

'>






</
asp
:
TextBox
><
br



/>

CIN:







<
asp
:
TextBox



ID
="CINTextBox"



runat
="server"



Text
='
<%# Bind("CIN") %>

'>






</
asp
:
TextBox
><
br



/>

NAISSANCE:







<
asp
:
TextBox



ID
="NAISSANCETextBox"



runat
="server"



Text
='
<%# Bind("NAISSANCE") %>

'>






</
asp
:
TextBox
><
br



/>

AFFECTATION:







<
asp
:
TextBox



ID
="AFFECTATIONTextBox"



runat
="server"



Text
='
<%# Bind("AFFECTATION") %>

'>






</
asp
:
TextBox
><
br



/>

ECHELLE:







<
asp
:
TextBox



ID
="ECHELLETextBox"



runat
="server"



Text
='
<%# Bind("ECHELLE") %>

'>






</
asp
:
TextBox
><
br



/>

ECHELON:







<
asp
:
TextBox



ID
="ECHELONTextBox"



runat
="server"



Text
='
<%# Bind("ECHELON") %>

'>






</
asp
:
TextBox
><
br



/>

CATEGORIE:







<
asp
:
TextBox



ID
="CATEGORIETextBox"



runat
="server"



Text
='
<%# Bind("CATEGORIE") %>

'>






</
asp
:
TextBox
><
br



/>

FONCTION:







<
asp
:
TextBox



ID
="FONCTIONTextBox"



runat
="server"



Text
='
<%# Bind("FONCTION") %>

'>






</
asp
:
TextBox
><
br



/>

ANCADMIN:







<
asp
:
TextBox



ID
="ANCADMINTextBox"



runat
="server"



Text
='
<%# Bind("ANCADMIN") %>

'>






</
asp
:
TextBox
><
br



/>

N_AFFIL-CRM:







<
asp
:
TextBox



ID
="N_AFFIL_CRMTextBox"



runat
="server"



Text
='
<%# Bind("[N_AFFIL-CRM]") %>

'>






</
asp
:
TextBox
><
br



/>






<
asp
:
LinkButton



ID
="InsertButton"



runat
="server"



CausesValidation
="True"



CommandName
="Insert"






Text
="Insert">






</
asp
:
LinkButton
>






<
asp
:
LinkButton



ID
="InsertCancelButton"



runat
="server"



CausesValidation
="False"



CommandName
="Cancel"






Text
="Cancel">






</
asp
:
LinkButton
>






</
InsertItemTemplate
>






<
ItemTemplate
>

MLE_PPR:







<
asp
:
Label



ID
="MLE_PPRLabel"



runat
="server"



Text
='
<%# Eval("MLE_PPR") %>

'></
asp
:
Label
><
br



/>

NOM_ PRENOM:







<
asp
:
Label



ID
="NOM__PRENOMLabel"



runat
="server"



Text
='
<%# Bind("[NOM_ PRENOM]") %>

'>






</
asp
:
Label
><
br



/>

CIN:







<
asp
:
Label



ID
="CINLabel"



runat
="server"



Text
='
<%# Bind("CIN") %>

'></
asp
:
Label
><
br



/>

NOM_ARABE:







<
asp
:
Label



ID
="NOM_ARABELabel"



runat
="server"



Text
='
<%# Bind("NOM_ARABE") %>

'></
asp
:
Label
><
br



/>

NAISSANCE:







<
asp
:
Label



ID
="NAISSANCELabel"



runat
="server"



Text
='
<%# Bind("NAISSANCE") %>

'></
asp
:
Label
><
br



/>

AFFECTATION:







<
asp
:
Label



ID
="AFFECTATIONLabel"



runat
="server"



Text
='
<%# Bind("AFFECTATION") %>

'>






</
asp
:
Label
><
br



/>

ECHELLE:







<
asp
:
Label



ID
="ECHELLELabel"



runat
="server"



Text
='
<%# Bind("ECHELLE") %>

'></
asp
:
Label
><
br



/>

ECHELON:







<
asp
:
Label



ID
="ECHELONLabel"



runat
="server"



Text
='
<%# Bind("ECHELON") %>

'></
asp
:
Label
><
br



/>

CATEGORIE:







<
asp
:
Label



ID
="CATEGORIELabel"



runat
="server"



Text
='
<%# Bind("CATEGORIE") %>

'></
asp
:
Label
><
br



/>

FONCTION:







<
asp
:
Label



ID
="FONCTIONLabel"



runat
="server"



Text
='
<%# Bind("FONCTION") %>

'></
asp
:
Label
><
br



/>

ANCADMIN:







<
asp
:
Label



ID
="ANCADMINLabel"



runat
="server"



Text
='
<%# Bind("ANCADMIN") %>

'></
asp
:
Label
><
br



/>

N_AFFIL-CRM:







<
asp
:
Label



ID
="N_AFFIL_CRMLabel"



runat
="server"



Text
='
<%# Bind("[N_AFFIL-CRM]") %>

'>






</
asp
:
Label
><
br



/>






<
asp
:
LinkButton



ID
="EditButton"



runat
="server"



CausesValidation
="False"



CommandName
="Edit"






Text
="Edit">






</
asp
:
LinkButton
>






<
asp
:
LinkButton



ID
="DeleteButton"



runat
="server"



CausesValidation
="False"



CommandName
="Delete"






Text
="Delete">






</
asp
:
LinkButton
>






<
asp
:
LinkButton



ID
="NewButton"



runat
="server"



CausesValidation
="False"



CommandName
="New"






Text
="New">






</
asp
:
LinkButton
>






</
ItemTemplate
>






<
FooterStyle



BackColor
="#F7DFB5"



ForeColor
="#8C4510"



/>






<
EditRowStyle



BackColor
="#738A9C"



Font-Bold
="True"



ForeColor
="White"



/>






<
RowStyle



BackColor
="#FFF7E7"



ForeColor
="#8C4510"



/>






<
PagerStyle



ForeColor
="#8C4510"



HorizontalAlign
="Center"



/>






<
HeaderStyle



BackColor
="#A55129"



Font-Bold
="True"



ForeColor
="White"



/>






</
asp
:
FormView
>






</
center
>






</
div
>






&nbsp;



&nbsp;&nbsp;



&nbsp;



&nbsp;



&nbsp;&nbsp;






<
asp
:
SqlDataSource



ID
="SqlDataSource1"



runat
="server"



CancelSelectOnNullParameter
="False"






ConflictDetection
="CompareAllValues"



ConnectionString
="
<%$ ConnectionStrings:ConnectionString %>

"






DeleteCommand
"DELETE FROM [LISTE_PERSONNEL] WHERE [MLE_PPR] ? AND [NOM_ PRENOM] = ? AND [CIN] = ? AND [NOM_ARABE] = ? AND [NAISSANCE] = ? AND [AFFECTATION] = ? AND [ECHELLE] = ? AND [ECHELON] = ? AND [CATEGORIE] = ? AND [FONCTION] = ? AND [ANCADMIN] = ? AND [N_AFFIL-CRM] = ?"






InsertCommand
="INSERT INTO [LISTE_PERSONNEL] ([MLE_PPR], [NOM_ PRENOM], [CIN], [NOM_ARABE], [NAISSANCE], [AFFECTATION], [ECHELLE], [ECHELON], [CATEGORIE], [FONCTION], [ANCADMIN], [N_AFFIL-CRM]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"






OldValuesParameterFormatString
="original_{0}"



ProviderName
="
<%$ ConnectionStrings:ConnectionString.ProviderName %>

"






SelectCommand
="SELECT * FROM [LISTE_PERSONNEL] WHERE ([NOM_ PRENOM] LIKE '%' + ? + '%')"



UpdateCommand
"UPDATE [LISTE_PERSONNEL] SET [NOM_ PRENOM] ?, [CIN] = ?, [NOM_ARABE] = ?, [NAISSANCE] = ?, [AFFECTATION] = ?, [ECHELLE] = ?, [ECHELON] = ?, [CATEGORIE] = ?, [FONCTION] = ?, [ANCADMIN] = ?, [N_AFFIL-CRM] = ? WHERE [MLE_PPR] = ? AND [NOM_ PRENOM] = ? AND [CIN] = ? AND [NOM_ARABE] = ? AND [NAISSANCE] = ? AND [AFFECTATION] = ? AND [ECHELLE] = ? AND [ECHELON] = ? AND [CATEGORIE] = ? AND [FONCTION] = ? AND [ANCADMIN] = ? AND [N_AFFIL-CRM] = ?">






<
DeleteParameters
>






<
asp
:
Parameter



Name
="original_MLE_PPR"



Type
="Double"



/>






<
asp
:
Parameter



Name
="original_NOM_PRENOM"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_CIN"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_NOM_ARABE"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_NAISSANCE"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_AFFECTATION"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_ECHELLE"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_ECHELON"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_CATEGORIE"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_FONCTION"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_ANCADMIN"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_column1"



Type
="String"



/>






</
DeleteParameters
>






<
UpdateParameters
>






<
asp
:
Parameter



Name
="NOM_PRENOM"



Type
="String"



/>






<
asp
:
Parameter



Name
="CIN"



Type
="String"



/>








<
asp
:
Parameter



Name
="NAISSANCE"



Type
="String"



/>






<
asp
:
Parameter



Name
="AFFECTATION"



Type
="String"



/>






<
asp
:
Parameter



Name
="ECHELLE"



Type
="String"



/>






<
asp
:
Parameter



Name
="ECHELON"



Type
="String"



/>






<
asp
:
Parameter



Name
="CATEGORIE"



Type
="String"



/>






<
asp
:
Parameter



Name
="FONCTION"



Type
="String"



/>






<
asp
:
Parameter



Name
="ANCADMIN"



Type
="String"



/>






<
asp
:
Parameter



Name
="column1"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_MLE_PPR"



Type
="Double"



/>






<
asp
:
Parameter



Name
="original_NOM_PRENOM"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_CIN"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_NOM_ARABE"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_NAISSANCE"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_AFFECTATION"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_ECHELLE"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_ECHELON"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_CATEGORIE"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_FONCTION"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_ANCADMIN"



Type
="String"



/>






<
asp
:
Parameter



Name
="original_column1"



Type
="String"



/>






</
UpdateParameters
>






<
InsertParameters
>






<
asp
:
Parameter



Name
="MLE_PPR"



Type
="Double"



/>






<
asp
:
Parameter



Name
="NOM_PRENOM"



Type
="String"



/>






<
asp
:
Parameter



Name
="CIN"



Type
="String"



/>






<
asp
:
Parameter



Name
="NOM_ARABE"



Type
="String"



/>






<
asp
:
Parameter



Name
="NAISSANCE"



Type
="String"



/>






<
asp
:
Parameter



Name
="AFFECTATION"



Type
="String"



/>






<
asp
:
Parameter



Name
="ECHELLE"



Type
="String"



/>






<
asp
:
Parameter



Name
="ECHELON"



Type
="String"



/>






<
asp
:
Parameter



Name
="CATEGORIE"



Type
="String"



/>






<
asp
:
Parameter



Name
="FONCTION"



Type
="String"



/>






<
asp
:
Parameter



Name
="ANCADMIN"



Type
="String"



/>






<
asp
:
Parameter



Name
="column1"



Type
="String"



/>






</
InsertParameters
>






<
SelectParameters
>






<
asp
:
ControlParameter



ControlID
="TextBox2"



Name
="NOM_PRENOM"



PropertyName
="Text"






Type
="String"



/>






</
SelectParameters
>






</
asp
:
SqlDataSource
>






&nbsp;









</
form
></


body
></


html
>

2 réponses

jesusonline Messages postés 6814 Date d'inscription dimanche 15 décembre 2002 Statut Membre Dernière intervention 13 octobre 2010 29
11 mars 2008 à 23:36
Bonjour,

aurais tu un message d'erreur ou quelque chose qui puisse nous avancer ? car donner son code en pature en attendant que quelqu'un le debug n'est pas forcément la meilleure solution ... :)

<hr />Cyril - MSP - MCPD ASP.net & MCTS SQL - Consultant indépendant
0
simo5266 Messages postés 13 Date d'inscription vendredi 28 octobre 2005 Statut Membre Dernière intervention 5 juillet 2008
12 mars 2008 à 00:19
rebonsoir,

merci d'abord de me repondre

voila l'erreur qui s'affiche :

"L'opération doit utiliser une requête qui peut être mise à jour"

j'ai vérifié les droits sur le dossier et tt mais toujours ca ne marche pas   
0
Rejoignez-nous