Probleme avec les DropDownList imbriqués
Bonjour,
J'essaye d'imbriquer deux DropDownList dans mon un formView, je reccupere les donnees sur les deux DorpDownList. mais quand je cique sur inserer une erreur s'affiche voila la code JSP.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
|
<asp:Content ID="Content1" ContentPlaceHolderID="nouveau_dossier" runat="server">
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:basedossierConnectionString %>"
SelectCommand="SELECT [num_dossier], [num_envoi_commune], [num_arrivee_agence], [date_arrivee_agence], [observation], [petitionaire], [date_envoi_commun], [num_envoi_agence], [date_envoi_agance], [id_commune], [code_projet], [reference_fonciere] FROM [dossier]">
</asp:SqlDataSource>
<asp:FormView ID="FormView1" runat="server" DataKeyNames="num_dossier"
DataSourceID="SqlDataSource1" DefaultMode="Insert">
<EditItemTemplate>
num_dossier:
<asp:Label ID="num_dossierLabel1" runat="server"
Text='<%# Eval("num_dossier") %>' />
<br />
num_envoi_commune:
<asp:TextBox ID="num_envoi_communeTextBox" runat="server"
Text='<%# Bind("num_envoi_commune") %>' />
<br />
num_arrivee_agence:
<asp:TextBox ID="num_arrivee_agenceTextBox" runat="server"
Text='<%# Bind("num_arrivee_agence") %>' />
<br />
date_arrivee_agence:
<asp:TextBox ID="date_arrivee_agenceTextBox" runat="server"
Text='<%# Bind("date_arrivee_agence") %>' />
<br />
observation:
<asp:TextBox ID="observationTextBox" runat="server"
Text='<%# Bind("observation") %>' />
<br />
petitionaire:
<asp:TextBox ID="petitionaireTextBox" runat="server"
Text='<%# Bind("petitionaire") %>' />
<br />
date_envoi_commun:
<asp:TextBox ID="date_envoi_communTextBox" runat="server"
Text='<%# Bind("date_envoi_commun") %>' />
<br />
num_envoi_agence:
<asp:TextBox ID="num_envoi_agenceTextBox" runat="server"
Text='<%# Bind("num_envoi_agence") %>' />
<br />
date_envoi_agance:
<asp:TextBox ID="date_envoi_aganceTextBox" runat="server"
Text='<%# Bind("date_envoi_agance") %>' />
<br />
id_commune:
<asp:TextBox ID="id_communeTextBox" runat="server"
Text='<%# Bind("id_commune") %>' />
<br />
code_projet:
<asp:TextBox ID="code_projetTextBox" runat="server"
Text='<%# Bind("code_projet") %>' />
<br />
reference_fonciere:
<asp:TextBox ID="reference_fonciereTextBox" runat="server"
Text='<%# Bind("reference_fonciere") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Mettre à jour" />
<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Annuler" />
</EditItemTemplate>
<InsertItemTemplate>
num_dossier:
<asp:TextBox ID="num_dossierTextBox" runat="server"
Text='<%# Bind("num_dossier") %>' />
<br />
num_envoi_commune:
<asp:TextBox ID="num_envoi_communeTextBox" runat="server"
Text='<%# Bind("num_envoi_commune") %>' />
<br />
num_arrivee_agence:
<asp:TextBox ID="num_arrivee_agenceTextBox" runat="server"
Text='<%# Bind("num_arrivee_agence") %>' />
<br />
date_arrivee_agence:
<asp:TextBox ID="date_arrivee_agenceTextBox" runat="server"
Text='<%# Bind("date_arrivee_agence") %>' />
<br />
observation:
<asp:TextBox ID="observationTextBox" runat="server"
Text='<%# Bind("observation") %>' />
<br />
petitionaire:
<asp:TextBox ID="petitionaireTextBox" runat="server"
Text='<%# Bind("petitionaire") %>' />
<br />
date_envoi_commun:
<asp:TextBox ID="date_envoi_communTextBox" runat="server"
Text='<%# Bind("date_envoi_commun") %>' />
<br />
num_envoi_agence:
<asp:TextBox ID="num_envoi_agenceTextBox" runat="server"
Text='<%# Bind("num_envoi_agence") %>' />
<br />
date_envoi_agance:
<asp:TextBox ID="date_envoi_aganceTextBox" runat="server"
Text='<%# Bind("date_envoi_agance") %>' />
<br />
id_commune:
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource3" DataTextField="id_commune"
DataValueField="id_commune" SelectedValue='<%# Bind("id_commune") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:basedossierConnectionString %>"
SelectCommand="SELECT [id_commune] FROM [commune]"></asp:SqlDataSource>
<br />
code_projet:
<asp:DropDownList ID="DropDownList2" runat="server"
DataSourceID="SqlDataSource2" DataTextField="code_projet"
DataValueField="code_projet" SelectedValue='<%# Bind("code_projet") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:basedossierConnectionString %>"
SelectCommand="SELECT [code_projet] FROM [projet]"></asp:SqlDataSource>
<br />
reference_fonciere:
<asp:TextBox ID="reference_fonciereTextBox" runat="server"
Text='<%# Bind("reference_fonciere") %>' />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insérer" />
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Annuler" />
</InsertItemTemplate>
<ItemTemplate>
Numero de dossier:
<asp:Label ID="num_dossierLabel" runat="server"
Text='<%# Eval("num_dossier") %>' />
<br />
Numero d'envoi par la commune:
<asp:Label ID="num_envoi_communeLabel" runat="server"
Text='<%# Bind("num_envoi_commune") %>' />
<br />
Numero d'arrivee a l'agence:
<asp:Label ID="num_arrivee_agenceLabel" runat="server"
Text='<%# Bind("num_arrivee_agence") %>' />
<br />
Date d'arrivee a l'agence:
<asp:Label ID="date_arrivee_agenceLabel" runat="server"
Text='<%# Bind("date_arrivee_agence") %>' />
<br />
Observation:
<asp:Label ID="observationLabel" runat="server"
Text='<%# Bind("observation") %>' />
<br />
Petitionaire:
<asp:Label ID="petitionaireLabel" runat="server"
Text='<%# Bind("petitionaire") %>' />
<br />
Date d'envoi au commune:
<asp:Label ID="date_envoi_communLabel" runat="server"
Text='<%# Bind("date_envoi_commun") %>' />
<br />
Numero d'envoi par l' agence:
<asp:Label ID="num_envoi_agenceLabel" runat="server"
Text='<%# Bind("num_envoi_agence") %>' />
<br />
Date d'envoi par l'agance:
<asp:Label ID="date_envoi_aganceLabel" runat="server"
Text='<%# Bind("date_envoi_agance") %>' />
<br />
Commune:
<asp:Label ID="id_communeLabel" runat="server"
Text='<%# Bind("id_commune") %>' />
<br />
Projet:
<asp:Label ID="code_projetLabel" runat="server"
Text='<%# Bind("code_projet") %>' />
<br />
Reference fonciere:
<asp:Label ID="reference_fonciereLabel" runat="server"
Text='<%# Bind("reference_fonciere") %>' />
<br />
</ItemTemplate>
</asp:FormView>
</asp:Content> |
l'erreur qui s'affiche pendant l'exécution est :
Citation:
Erreur du serveur dans l'application '/'.
L'insertion n'est pas prise en charge par la source de données 'SqlDataSource1' sauf si InsertCommand est spécifié.
Description : Une exception non gérée s'est produite au moment de l'exécution de la demande Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.
Détails de l'exception: System.NotSupportedException: L'insertion n'est pas prise en charge par la source de données 'SqlDataSource1' sauf si InsertCommand est spécifié.
Erreur source:
Une exception non gérée s'est produite lors de l'exécution de la demande Web actuelle. Les informations relatives à l'origine et l'emplacement de l'exception peuvent être identifiées en utilisant la trace de la pile d'exception ci-dessous.
Trace de la pile:
[NotSupportedException: L'insertion n'est pas prise en charge par la source de données 'SqlDataSource1' sauf si InsertCommand est spécifié.]
System.Web.UI.WebControls.SqlDataSourceView.ExecuteInsert(IDictionary values) +1645168
System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +86
System.Web.UI.WebControls.FormView.HandleInsert(String commandArg, Boolean causesValidation) +272
System.Web.UI.WebControls.FormView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +676
System.Web.UI.WebControls.FormView.OnBubbleEvent(Object source, EventArgs e) +95
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.FormViewRow.OnBubbleEvent(Object source, EventArgs e) +113
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
pouvez vous m'aider merci .