CodeSmith Community
Your Code. Your Way. Faster!

Updating is not supported by ObjectDataSource 'ObjectDataSource1' unless the UpdateMethod is specified.

Latest post 03-16-2007 4:57 AM by mfaisal. 2 replies.
  • 03-15-2007 6:29 AM

    • mfaisal
    • Not Ranked
    • Joined on 03-07-2007
    • Posts 2
    • Points 40

    Updating is not supported by ObjectDataSource 'ObjectDataSource1' unless the UpdateMethod is specified.

    Hi,

    Can someone help me out regarding this error. As relatively new to .nettiers can somebody tells where to write the update method.I am using the view to retrieve the data. I am using service layer to add my custom methods as per my requirement. Also please give some suggestion about writing my own insert method.

    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="pp" DataTextField="Prj_Name" DataValueField="Prj_ID" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">

    </asp:DropDownList><br />

    <data:ProjectsDataSource runat="server" SelectMethod="GetPaged" ID="pp" EnablePaging="True" EnableSorting="True" EnableTransaction="False">

    <DeepLoadProperties Method="IncludeChildren" Recursive="False">

    </DeepLoadProperties>

    </data:ProjectsDataSource>

    <br />

    Components List&nbsp;<br />

    <asp:GridView ID="GridView1" runat="server" AllowPaging="True"

    AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" EnableSortingAndPagingCallbacks="True">

    <Columns>

    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />

    <asp:BoundField DataField="Comp_Name" HeaderText="Comp_Name" SortExpression="Comp_Name" />

    <asp:BoundField DataField="Comp_Description" HeaderText="Comp_Description" SortExpression="Comp_Description" />

    </Columns>

    </asp:GridView>

    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"

    SelectMethod="getbypid" TypeName="EstratsBugTracker.Services.PrjComponentsService">

    <SelectParameters>

    <asp:ControlParameter ControlID="DropDownList1" Name="whereClause" PropertyName="SelectedValue"

    Type="String" />

    <asp:Parameter Name="orderby" Type="String" />

    </SelectParameters>

    </asp:ObjectDataSource>

     

    • Post Points: 35
  • 03-15-2007 4:32 PM In reply to

    • mike123
    • Top 10 Contributor
    • Joined on 02-25-2005
    • Toronto, Ontario
    • Posts 726
    • Points 16,910

    Re: Updating is not supported by ObjectDataSource 'ObjectDataSource1' unless the UpdateMethod is specified.

    mfaisal,

    If you generate webadmin you'll be able to see, how to populate GridView using Typed DataSource controls and also edit record in-line or via FormView  

    Mike Shatny
    --------------------------------------------------------------
    Member of the .netTiers team http://www.nettiers.com
    --------------------------------------------------------------

    • Post Points: 35
  • 03-16-2007 4:57 AM In reply to

    • mfaisal
    • Not Ranked
    • Joined on 03-07-2007
    • Posts 2
    • Points 40

    Re: Updating is not supported by ObjectDataSource 'ObjectDataSource1' unless the UpdateMethod is specified.

    mike thnx for ur reply but it wasn't that much helpful to sort out my problem. Anyway can you please tell me how and where to write the insert method.
    • Post Points: 5
Page 1 of 1 (3 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems