Ciao, in effetti ho utilizzato questo sistema e mi da quanto desideravo, tuttavia, certamente a causa della mi inesperienza ni mi segnala l'errore @cor_breve campo non dichiarato...ti posto parte del codicecodice:<script runat="server"> Sub page_load(ByVal sender As Object, ByVal e As EventArgs) Dim conn As New SqlConnection("Data Source=10.10.10.3,1434\SQLEXPRESS;Initial Catalog=NOTPREL;User Id=mauri1961;Password=bussa1961") Dim command As New SqlCommand("select * from corsi where cor_breve=' " & Request.QueryString("lkcomm").ToString() & "'", conn) conn.Open() conn.Close() End Sub Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Dim DetailsView1 As DetailsView = DirectCast(sender, DetailsView) If DetailsView1.CurrentMode = DetailsViewMode.Edit OrElse DetailsView1.CurrentMode = DetailsViewMode.Insert Then 'Replace the row and cell numbers with the appropriate ones for your DetailsView DirectCast(DetailsView1.Rows(5).Cells(1).Controls(0), TextBox).TextMode = TextBoxMode.MultiLine End If End Sub </script> <asp:DetailsView ID="DetailsView1" runat="server" Width="950px" AutoGenerateRows="False" BackColor="White" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataSourceID="SqlDataSource1" style="margin-right: 2px; margin-left: 2px;" DataKeyNames="cor_breve" Font-Names="arial" Font-Size="Large" HeaderText="VARIAZIONE CORSI " CellSpacing="2" EnableModelValidation="True" DefaultMode="Edit" GridLines="Horizontal" AutoGenerateEditButton="true" AutoGenerateDeleteButton="true" AutoGenerateInsertButton="true"> <EditRowStyle BackColor="white" Font-Bold="True" ForeColor="black" /> <Fields> <asp:BoundField DataField="cor_breve" HeaderText="Codice corso" SortExpression="cor_breve" ReadOnly="True" > <ControlStyle Height="30px" Width="100px" /> <HeaderStyle Font-Bold="True" Font-Size="small" HorizontalAlign="Left" VerticalAlign="Top" /> <ItemStyle Width="50px" /> </asp:BoundField> <asp:TemplateField HeaderText="Corso"> <HeaderStyle Font-Bold="True" Font-Size="medium" HorizontalAlign="Left" VerticalAlign="Top" /> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("cor_corso") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="update" ClientIDMode="Static" TextMode="MultiLine" Text='<%# Eval("cor_corso") %>' Height="100px" Width="600px" runat="server"></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="insert" ClientIDMode="Static" TextMode="MultiLine" Text="" Height="100px" runat="server"></asp:TextBox> </InsertItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Testo Scheda"> <HeaderStyle Font-Bold="True" Font-Size="small" HorizontalAlign="Left" VerticalAlign="Top" /> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("cor_note") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="update" ClientIDMode="Static" TextMode="MultiLine" Text='<%# Eval("cor_note") %>' Height="600px" Width="600px" runat="server"></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="insert" ClientIDMode="Static" TextMode="MultiLine" Text="" Height="100px" runat="server"></asp:TextBox> </InsertItemTemplate> </asp:TemplateField> </Fields> <FooterStyle BackColor="white" ForeColor="#8C4510" /> <HeaderStyle BackColor="white" Font-Bold="True" ForeColor="black" /> <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" /> <RowStyle BackColor="white" ForeColor="black" /> </asp:DetailsView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=10.10.10.3,1434\SQLEXPRESS;Initial Catalog=NOTPREL;User Id=mauri1961;Password=bussa1961" ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [CORSI] WHERE ([cor_breve] = @cor_breve)" UpdateCommand="UPDATE [corsi] SET [cor_corso] = @cor_corso, , [cor_note] = @cor_note WHERE [cor_breve] = @cor_breve"> <UpdateParameters> <asp:Parameter Name="@cor_breve" Type="String"/> <asp:Parameter Name="@cor_corso" Type="String" /> <asp:Parameter Name="@cor_note" Type="String" /> </UpdateParameters> </asp:SqlDataSource> <br />..pre brevità ho evitato di mettere nel codice postato tutti i campi
grazie in anticipo... Maurizio

Rispondi quotando