Hi all,
I'm getting this error:
ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: blah blah
I searched the web and tried to find ways to fix this problem. Some suggestions were to change the
OldValuesParameterFormatString="original_{0}" to
OldValuesParameterFormatString="{0}"
I did that but now the thing doesn't even update so if I put it back in I get the first problem. I'm about to tear my hair out. I'll post my code and see if you can find the problem. record_id is my pk.
Thanks!
I'm getting this error:
ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: blah blah
I searched the web and tried to find ways to fix this problem. Some suggestions were to change the
OldValuesParameterFormatString="original_{0}" to
OldValuesParameterFormatString="{0}"
I did that but now the thing doesn't even update so if I put it back in I get the first problem. I'm about to tear my hair out. I'll post my code and see if you can find the problem. record_id is my pk.
Code:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Spending Plan" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource2"
DataTextField="district" DataValueField="id" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1"
DataTextField="district" DataValueField="id">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList3" runat="server">
<asp:ListItem>2007</asp:ListItem>
<asp:ListItem>2008</asp:ListItem>
<asp:ListItem>2009</asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Spending_PlanConnectionString %>"
SelectCommand="SELECT [id], [district] FROM [planName]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Spending_PlanConnectionString %>"
SelectCommand="SELECT [id], [district] FROM [district]"></asp:SqlDataSource>
<br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
DataKeyNames="record_id" DataSourceID="ObjectDataSource1" ForeColor="#333333">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:CommandField ShowEditButton="True" ButtonType="Button" />
<asp:BoundField DataField="cat_id" HeaderText="Category" SortExpression="cat_id" ReadOnly="True" />
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label27" runat="server" Text="Actual"></asp:Label> <br />
<asp:Label ID="Label13" runat="server" Text="Projected"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="July" SortExpression="july_actual">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("july_actual", "{0:N2}") %>'></asp:TextBox> <br />
<asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("july_projected", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("july_actual", "{0:C2}") %>'></asp:Label> <br />
<asp:Label ID="Label13" runat="server" Text='<%# Bind("july_projected", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="August" SortExpression="august_actual">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("august_actual", "{0:N2}") %>'></asp:TextBox> <br />
<asp:TextBox ID="TextBox14" runat="server" Text='<%# Bind("august_projected", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("august_actual", "{0:C2}") %>'></asp:Label> <br />
<asp:Label ID="Label14" runat="server" Text='<%# Bind("august_projected", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="September" SortExpression="sept_actual">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("sept_actual", "{0:N2}") %>'></asp:TextBox> <br />
<asp:TextBox ID="TextBox15" runat="server" Text='<%# Bind("sept_projected", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("sept_actual", "{0:C2}") %>'></asp:Label> <br />
<asp:Label ID="Label15" runat="server" Text='<%# Bind("sept_projected", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="October" SortExpression="oct_actual">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("oct_actual", "{0:N2}") %>'></asp:TextBox> <br />
<asp:TextBox ID="TextBox16" runat="server" Text='<%# Bind("oct_projected", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("oct_actual", "{0:C2}") %>'></asp:Label> <br />
<asp:Label ID="Label16" runat="server" Text='<%# Bind("oct_projected", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="November" SortExpression="nov_actual">
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("nov_actual", "{0:N2}") %>'></asp:TextBox> <br />
<asp:TextBox ID="TextBox17" runat="server" Text='<%# Bind("nov_projected", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("nov_actual", "{0:C2}") %>'></asp:Label> <br />
<asp:Label ID="Label17" runat="server" Text='<%# Bind("nov_projected", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="December" SortExpression="dec_actual">
<EditItemTemplate>
<asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("dec_actual", "{0:N2}") %>'></asp:TextBox> <br />
<asp:TextBox ID="TextBox18" runat="server" Text='<%# Bind("dec_projected", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Bind("dec_actual", "{0:C2}") %>'></asp:Label> <br />
<asp:Label ID="Label18" runat="server" Text='<%# Bind("dec_projected", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="January" SortExpression="jan_actual">
<EditItemTemplate>
<asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("jan_actual", "{0:N2}") %>'></asp:TextBox> <br />
<asp:TextBox ID="TextBox19" runat="server" Text='<%# Bind("jan_projected", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# Bind("jan_actual", "{0:C2}") %>'></asp:Label> <br />
<asp:Label ID="Label19" runat="server" Text='<%# Bind("jan_projected", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="February" SortExpression="feb_actual">
<EditItemTemplate>
<asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("feb_actual", "{0:N2}") %>'></asp:TextBox> <br />
<asp:TextBox ID="TextBox20" runat="server" Text='<%# Bind("feb_projected", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label8" runat="server" Text='<%# Bind("feb_actual", "{0:C2}") %>'></asp:Label> <br />
<asp:Label ID="Label20" runat="server" Text='<%# Bind("feb_projected", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="March" SortExpression="march_actual">
<EditItemTemplate>
<asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("march_actual", "{0:N2}") %>'></asp:TextBox> <br />
<asp:TextBox ID="TextBox21" runat="server" Text='<%# Bind("march_projected", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label9" runat="server" Text='<%# Bind("march_actual", "{0:C2}") %>'></asp:Label> <br />
<asp:Label ID="Label21" runat="server" Text='<%# Bind("march_projected", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="April" SortExpression="april_actual">
<EditItemTemplate>
<asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("april_actual", "{0:N2}") %>'></asp:TextBox> <br />
<asp:TextBox ID="TextBox22" runat="server" Text='<%# Bind("april_projected", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label10" runat="server" Text='<%# Bind("april_actual", "{0:C2}") %>'></asp:Label> <br />
<asp:Label ID="Label22" runat="server" Text='<%# Bind("april_projected", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="May" SortExpression="may_actual">
<EditItemTemplate>
<asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("may_actual", "{0:N2}") %>'></asp:TextBox> <br />
<asp:TextBox ID="TextBox23" runat="server" Text='<%# Bind("may_projected", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label11" runat="server" Text='<%# Bind("may_actual", "{0:C2}") %>'></asp:Label> <br />
<asp:Label ID="Label23" runat="server" Text='<%# Bind("may_projected", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="June" SortExpression="june_actual">
<EditItemTemplate>
<asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("june_actual", "{0:N2}") %>'></asp:TextBox> <br />
<asp:TextBox ID="TextBox24" runat="server" Text='<%# Bind("june_projected", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label12" runat="server" Text='<%# Bind("june_actual", "{0:C2}") %>'></asp:Label> <br />
<asp:Label ID="Label24" runat="server" Text='<%# Bind("june_projected", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="encub_ytd" SortExpression="encub_ytd">
<EditItemTemplate>
<asp:TextBox ID="TextBox25" runat="server" Text='<%# Bind("encub_ytd", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label25" runat="server" Text='<%# Bind("encub_ytd", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="adjustments" SortExpression="adjustments">
<EditItemTemplate>
<asp:TextBox ID="TextBox26" runat="server" Text='<%# Bind("adjustments", "{0:N2}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label26" runat="server" Text='<%# Bind("adjustments", "{0:C2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="record_id" SortExpression="record_id" Visible="False">
<EditItemTemplate>
<asp:TextBox ID="TextBox27" runat="server" Text='<%# Bind("record_id") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label28" runat="server" Text='<%# Bind("record_id") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="district_id" HeaderText="district_id" SortExpression="district_id"
Visible="False" />
<asp:BoundField DataField="fiscal_year" HeaderText="fiscal_year" SortExpression="fiscal_year"
Visible="False" />
<asp:BoundField DataField="sheet" HeaderText="sheet" SortExpression="sheet" Visible="False" />
<asp:BoundField DataField="record_id" HeaderText="Record ID" SortExpression="record_id" ReadOnly="True" Visible="False" />
</Columns>
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"
InsertMethod="Insert" SelectMethod="GetAppropbydiscatsheetfy"
TypeName="DataSet2TableAdapters.appropriations2TableAdapter" UpdateMethod="Update" OldValuesParameterFormatString="{0}">
<DeleteParameters>
<asp:Parameter Name="Original_cat_id" Type="String" />
<asp:Parameter Name="Original_july_actual" Type="Decimal" />
<asp:Parameter Name="Original_august_actual" Type="Decimal" />
<asp:Parameter Name="Original_sept_actual" Type="Decimal" />
<asp:Parameter Name="Original_oct_actual" Type="Decimal" />
<asp:Parameter Name="Original_nov_actual" Type="Decimal" />
<asp:Parameter Name="Original_dec_actual" Type="Decimal" />
<asp:Parameter Name="Original_jan_actual" Type="Decimal" />
<asp:Parameter Name="Original_feb_actual" Type="Decimal" />
<asp:Parameter Name="Original_march_actual" Type="Decimal" />
<asp:Parameter Name="Original_april_actual" Type="Decimal" />
<asp:Parameter Name="Original_may_actual" Type="Decimal" />
<asp:Parameter Name="Original_june_actual" Type="Decimal" />
<asp:Parameter Name="Original_july_projected" Type="Decimal" />
<asp:Parameter Name="Original_august_projected" Type="Decimal" />
<asp:Parameter Name="Original_sept_projected" Type="Decimal" />
<asp:Parameter Name="Original_oct_projected" Type="Decimal" />
<asp:Parameter Name="Original_nov_projected" Type="Decimal" />
<asp:Parameter Name="Original_dec_projected" Type="Decimal" />
<asp:Parameter Name="Original_jan_projected" Type="Decimal" />
<asp:Parameter Name="Original_feb_projected" Type="Decimal" />
<asp:Parameter Name="Original_march_projected" Type="Decimal" />
<asp:Parameter Name="Original_april_projected" Type="Decimal" />
<asp:Parameter Name="Original_may_projected" Type="Decimal" />
<asp:Parameter Name="Original_june_projected" Type="Decimal" />
<asp:Parameter Name="Original_encub_ytd" Type="Decimal" />
<asp:Parameter Name="Original_adjustments" Type="Decimal" />
<asp:Parameter Name="Original_record_id" Type="Decimal" />
<asp:Parameter Name="Original_district_id" Type="Int32" />
<asp:Parameter Name="Original_fiscal_year" Type="Decimal" />
<asp:Parameter Name="Original_sheet" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="cat_id" Type="String" />
<asp:Parameter Name="july_actual" Type="Decimal" />
<asp:Parameter Name="august_actual" Type="Decimal" />
<asp:Parameter Name="sept_actual" Type="Decimal" />
<asp:Parameter Name="oct_actual" Type="Decimal" />
<asp:Parameter Name="nov_actual" Type="Decimal" />
<asp:Parameter Name="dec_actual" Type="Decimal" />
<asp:Parameter Name="jan_actual" Type="Decimal" />
<asp:Parameter Name="feb_actual" Type="Decimal" />
<asp:Parameter Name="march_actual" Type="Decimal" />
<asp:Parameter Name="april_actual" Type="Decimal" />
<asp:Parameter Name="may_actual" Type="Decimal" />
<asp:Parameter Name="june_actual" Type="Decimal" />
<asp:Parameter Name="july_projected" Type="Decimal" />
<asp:Parameter Name="august_projected" Type="Decimal" />
<asp:Parameter Name="sept_projected" Type="Decimal" />
<asp:Parameter Name="oct_projected" Type="Decimal" />
<asp:Parameter Name="nov_projected" Type="Decimal" />
<asp:Parameter Name="dec_projected" Type="Decimal" />
<asp:Parameter Name="jan_projected" Type="Decimal" />
<asp:Parameter Name="feb_projected" Type="Decimal" />
<asp:Parameter Name="march_projected" Type="Decimal" />
<asp:Parameter Name="april_projected" Type="Decimal" />
<asp:Parameter Name="may_projected" Type="Decimal" />
<asp:Parameter Name="june_projected" Type="Decimal" />
<asp:Parameter Name="encub_ytd" Type="Decimal" />
<asp:Parameter Name="adjustments" Type="Decimal" />
<asp:Parameter Name="district_id" Type="Int32" />
<asp:Parameter Name="fiscal_year" Type="Decimal" />
<asp:Parameter Name="sheet" Type="Int32" />
<asp:Parameter Name="Original_cat_id" Type="String" />
<asp:Parameter Name="Original_july_actual" Type="Decimal" />
<asp:Parameter Name="Original_august_actual" Type="Decimal" />
<asp:Parameter Name="Original_sept_actual" Type="Decimal" />
<asp:Parameter Name="Original_oct_actual" Type="Decimal" />
<asp:Parameter Name="Original_nov_actual" Type="Decimal" />
<asp:Parameter Name="Original_dec_actual" Type="Decimal" />
<asp:Parameter Name="Original_jan_actual" Type="Decimal" />
<asp:Parameter Name="Original_feb_actual" Type="Decimal" />
<asp:Parameter Name="Original_march_actual" Type="Decimal" />
<asp:Parameter Name="Original_april_actual" Type="Decimal" />
<asp:Parameter Name="Original_may_actual" Type="Decimal" />
<asp:Parameter Name="Original_june_actual" Type="Decimal" />
<asp:Parameter Name="Original_july_projected" Type="Decimal" />
<asp:Parameter Name="Original_august_projected" Type="Decimal" />
<asp:Parameter Name="Original_sept_projected" Type="Decimal" />
<asp:Parameter Name="Original_oct_projected" Type="Decimal" />
<asp:Parameter Name="Original_nov_projected" Type="Decimal" />
<asp:Parameter Name="Original_dec_projected" Type="Decimal" />
<asp:Parameter Name="Original_jan_projected" Type="Decimal" />
<asp:Parameter Name="Original_feb_projected" Type="Decimal" />
<asp:Parameter Name="Original_march_projected" Type="Decimal" />
<asp:Parameter Name="Original_april_projected" Type="Decimal" />
<asp:Parameter Name="Original_may_projected" Type="Decimal" />
<asp:Parameter Name="Original_june_projected" Type="Decimal" />
<asp:Parameter Name="Original_encub_ytd" Type="Decimal" />
<asp:Parameter Name="Original_adjustments" Type="Decimal" />
<asp:Parameter Name="Original_record_id" Type="Decimal" />
<asp:Parameter Name="Original_district_id" Type="Int32" />
<asp:Parameter Name="Original_fiscal_year" Type="Decimal" />
<asp:Parameter Name="Original_sheet" Type="Int32" />
<asp:Parameter Name="record_id" Type="Decimal" />
</UpdateParameters>
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="district_id" PropertyName="SelectedValue"
Type="Int32" />
<asp:ControlParameter ControlID="DropDownList2" Name="sheet" PropertyName="SelectedValue"
Type="Int32" />
<asp:ControlParameter ControlID="DropDownList3" Name="fiscal_year" PropertyName="SelectedValue"
Type="Decimal" />
</SelectParameters>
<InsertParameters>
<asp:Parameter Name="cat_id" Type="String" />
<asp:Parameter Name="july_actual" Type="Decimal" />
<asp:Parameter Name="august_actual" Type="Decimal" />
<asp:Parameter Name="sept_actual" Type="Decimal" />
<asp:Parameter Name="oct_actual" Type="Decimal" />
<asp:Parameter Name="nov_actual" Type="Decimal" />
<asp:Parameter Name="dec_actual" Type="Decimal" />
<asp:Parameter Name="jan_actual" Type="Decimal" />
<asp:Parameter Name="feb_actual" Type="Decimal" />
<asp:Parameter Name="march_actual" Type="Decimal" />
<asp:Parameter Name="april_actual" Type="Decimal" />
<asp:Parameter Name="may_actual" Type="Decimal" />
<asp:Parameter Name="june_actual" Type="Decimal" />
<asp:Parameter Name="july_projected" Type="Decimal" />
<asp:Parameter Name="august_projected" Type="Decimal" />
<asp:Parameter Name="sept_projected" Type="Decimal" />
<asp:Parameter Name="oct_projected" Type="Decimal" />
<asp:Parameter Name="nov_projected" Type="Decimal" />
<asp:Parameter Name="dec_projected" Type="Decimal" />
<asp:Parameter Name="jan_projected" Type="Decimal" />
<asp:Parameter Name="feb_projected" Type="Decimal" />
<asp:Parameter Name="march_projected" Type="Decimal" />
<asp:Parameter Name="april_projected" Type="Decimal" />
<asp:Parameter Name="may_projected" Type="Decimal" />
<asp:Parameter Name="june_projected" Type="Decimal" />
<asp:Parameter Name="encub_ytd" Type="Decimal" />
<asp:Parameter Name="adjustments" Type="Decimal" />
<asp:Parameter Name="district_id" Type="Int32" />
<asp:Parameter Name="fiscal_year" Type="Decimal" />
<asp:Parameter Name="sheet" Type="Int32" />
</InsertParameters>
</asp:ObjectDataSource>
</asp:Content>