<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [nazev], [text], [id_clena] FROM [Novinky]"
InsertCommand="INSERT INTO Novinky(nazev, text, id_clena) VALUES (@nazev, @text, @id_clena)" >
<InsertParameters>
<asp:Parameter Name="nazev" />
<asp:Parameter Name="text" />
<asp:ControlParameter ControlID="DropDownList1" PropertyName="SelectedValue" Name="id_clena" Type="String"/>
</InsertParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT id_Clena, jmeno+' '+prijmeni AS autor FROM Clenove" >
</asp:SqlDataSource>
<asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1"
DefaultMode="Insert" >
<EditItemTemplate>
nazev:
<asp:TextBox ID="nazevTextBox" runat="server" Text='<%# Bind("nazev") %>' />
<br />
text:
<asp:TextBox ID="textTextBox" runat="server"
Text='<%# Bind("text") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<InsertItemTemplate>
nazev:
<asp:TextBox ID="nazevTextBox" runat="server" Text='<%# Bind("nazev") %>' />
<br />
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource2" DataTextField="autor"
AppendDataBoundItems="True" DataValueField="id_Clena">
<asp:ListItem />
</asp:DropDownList>
<br />
text:
<asp:TextBox ID="textTextBox" runat="server" Text='<%# Bind("text") %>'
/>
<br />
<asp:Button ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
<asp:Button ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
</asp:FormView>
Právě, že mi to psalo, že ho nemůže najít a když jsem to vyhodil mimo formView tak to najde.
|