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
>
</
center
>
<
center
>
</
center
>
<
center
>
</
center
>
<
center
>
</
center
>
<
center
>
</
center
>
<
center
>
<
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
>
</
center
>
<
center
>
</
center
>
<
center
>
<
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
>
<
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
>
</
form
></
body
></
html
>
Afficher la suite