Hi,
I got a GridView. I prepared UpdateCommands, run the page, click the edit button, the row falls into edit-mode, I change a value and click the standard update button/link... the system return with an error saying: no source code available for the current position. What am I missing in this update call?
Any hint is highly appreciated.
SQL UPDATE COMMAND
UpdateCommand="UPDATE [InvoiceElements] SET [InvoiceID] = @InvoiceID, [ElementTypeID] = @ElementTypeID, [Description] = @Description, [Cost] = @Cost, [ShareOfCostInPercentByRenter] = @ShareOfCostInPercentByRenter WHERE [ID] = @ID">
PARAMETERS
<UpdateParameters>
<asp
arameter Name="InvoiceID" Type="Int32" />
<asp
arameter Name="ElementTypeID" Type="Int32" />
<asp
arameter Name="Description" Type="String" />
<asp
arameter Name="Cost" Type="Decimal" />
<asp
arameter Name="ShareOfCostInPercentByRenter" Type="Decimal" />
<asp
arameter Name="ID" Type="Int32" />
</UpdateParameters>
GRIDVIEW
<asp:GridView id="GridViewInvoiceElements" runat="server" ForeColor="#333333" DataSourceID="InvoiceElementsDS" AllowSorting="True" DataKeyNames="ID" AllowPaging="True" AutoGenerateColumns="False" GridLines="None" CellPadding="4">
<FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True"></FooterStyle>
<Columns>
<asp:BoundField DataField="InvoiceID" SortExpression="InvoiceID" HeaderText="RG-Nr."></asp:BoundField>
<asp:BoundField ReadOnly="True" DataField="ID" InsertVisible="False" SortExpression="ID" HeaderText="ID"></asp:BoundField>
<asp:TemplateField HeaderText="Kostenart" SortExpression="ElementType">
<EditItemTemplate>
<asp
ropDownList ID="ElementTypeID" runat="server" AppendDataBoundItems="false" DataSourceID="ElementTypesDS" DataTextField="ElementType" DataValueField="ID" EnableViewState="false" SelectedValue='<%# Bind("ElementTypeID") %>'></asp
ropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<% Eval("ElementType") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Description" SortExpression="Description" HeaderText="Beschrieb"></asp:BoundField>
<asp:BoundField DataField="Cost" SortExpression="Cost" HeaderText="Betrag"></asp:BoundField>
<asp:BoundField DataFormatString="{0:}%" DataField="ShareOfCostInPercentByRenter" SortExpression="ShareOfCostInPercentByRenter" HeaderText="Mieteranteil"></asp:BoundField>
<asp:CommandField ShowEditButton="True"></asp:CommandField>
<asp:CommandField ShowDeleteButton="True"></asp:CommandField>
</Columns>
</asp:GridView>
I got a GridView. I prepared UpdateCommands, run the page, click the edit button, the row falls into edit-mode, I change a value and click the standard update button/link... the system return with an error saying: no source code available for the current position. What am I missing in this update call?
Any hint is highly appreciated.
SQL UPDATE COMMAND
UpdateCommand="UPDATE [InvoiceElements] SET [InvoiceID] = @InvoiceID, [ElementTypeID] = @ElementTypeID, [Description] = @Description, [Cost] = @Cost, [ShareOfCostInPercentByRenter] = @ShareOfCostInPercentByRenter WHERE [ID] = @ID">
PARAMETERS
<UpdateParameters>
<asp
<asp
<asp
<asp
<asp
<asp
</UpdateParameters>
GRIDVIEW
<asp:GridView id="GridViewInvoiceElements" runat="server" ForeColor="#333333" DataSourceID="InvoiceElementsDS" AllowSorting="True" DataKeyNames="ID" AllowPaging="True" AutoGenerateColumns="False" GridLines="None" CellPadding="4">
<FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True"></FooterStyle>
<Columns>
<asp:BoundField DataField="InvoiceID" SortExpression="InvoiceID" HeaderText="RG-Nr."></asp:BoundField>
<asp:BoundField ReadOnly="True" DataField="ID" InsertVisible="False" SortExpression="ID" HeaderText="ID"></asp:BoundField>
<asp:TemplateField HeaderText="Kostenart" SortExpression="ElementType">
<EditItemTemplate>
<asp
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<% Eval("ElementType") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Description" SortExpression="Description" HeaderText="Beschrieb"></asp:BoundField>
<asp:BoundField DataField="Cost" SortExpression="Cost" HeaderText="Betrag"></asp:BoundField>
<asp:BoundField DataFormatString="{0:}%" DataField="ShareOfCostInPercentByRenter" SortExpression="ShareOfCostInPercentByRenter" HeaderText="Mieteranteil"></asp:BoundField>
<asp:CommandField ShowEditButton="True"></asp:CommandField>
<asp:CommandField ShowDeleteButton="True"></asp:CommandField>
</Columns>
</asp:GridView>