[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

objectdatasource incompatible with datasets?

Posted on 2009-07-02
4
Medium Priority
?
371 Views
Last Modified: 2012-06-27
I've been  trying to get a dataset to work with an objectdatasource for an ASP.NET page.
The Select (FILL) works just fine, however the update, insert and delete do not work at all.

Is there an example anywhere showing a GridView bound to an ObjectDataSource bound to a DataSet?
0
Comment
Question by:bd9000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 24767472
0
 

Author Comment

by:bd9000
ID: 24767799
I've been there already. There are no examples on any of those links for CRUD using ODS and DS.

I basically create a DataSet in the wizard and create all the procedures for inserting, updating, deleting and selecting from an SQL datastore.
Tested all procedures on the SQL side and via the VS2008 designer.
Created a new ObjectDataSource with the wizard and  verified all parameters - they match - no errors.
Setup a grid using the ODS just created.
Run the page, all items show up in their respective columns, no problem.
Click an edit button, change a value, click Update, nothing happens, no errors, no changes in the SQL table, nada!  The page is posted back and the update is indeed called, just updates nothing.  The dataset is also not updated.
Paging works, sorting works, etc.

Just 1 single example showing UPDATE, DELETE, and INSERT working with a dataset designed by the dataset designer.

All works fine with an SQLDataSource, but I need to use an object (and I assumed that's why MS has the dataset designer - to reduce hours and days of hand coding every single business object!)




<asp:ObjectDataSource ID="ODSAdminMerchantLinks" runat="server" DeleteMethod="Delete" EnablePaging="True"
        InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectCountMethod="CountMerchLinks"
        SelectMethod="GetData"  UpdateMethod="Update" TypeName="DSAdminMerchLinksTableAdapters.LinksTableAdapter">
        <DeleteParameters>
            <asp:Parameter Name="Original_LinkID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="MerchName" Type="String" />
            <asp:Parameter Name="MerchDescr" Type="String" />
            <asp:Parameter Name="BannerCode" Type="String" />
            <asp:Parameter Name="BannerImagePath" Type="String" />
            <asp:Parameter Name="TextLinkCode" Type="String" />
            <asp:Parameter Name="TextLinkText" Type="String" />
            <asp:Parameter Name="MerchSource" Type="String" />
            <asp:Parameter Name="IsFree" Type="Boolean" />
            <asp:Parameter Name="IsFeatured" Type="Boolean" />
            <asp:Parameter Name="Keywords" Type="String" />
            <asp:Parameter Name="CommPct" Type="Decimal" />
            <asp:Parameter Name="CommPerClick" Type="Decimal" />
            <asp:Parameter Name="CommPerSale" Type="Decimal" />
            <asp:Parameter Name="SiteURL" Type="String" />
            <asp:Parameter Name="SEKeywords" Type="String" />
            <asp:Parameter Name="SEName" Type="String" />
            <asp:Parameter Name="SETitle" Type="String" />
            <asp:Parameter Name="SEDescr" Type="String" />
            <asp:Parameter Name="SENoScript" Type="String" />
            <asp:Parameter Name="SEAltText" Type="String" />
            <asp:Parameter Name="Published" Type="Boolean" />
            <asp:Parameter Name="Deleted" Type="Boolean" />
            <asp:Parameter Name="CssClassName" Type="String" />
            <asp:Parameter Name="CssClassTextLinkText" Type="String" />
            <asp:Parameter Name="CssClassMerchDescr" Type="String" />
            <asp:Parameter Name="DisplayOrder" Type="Int32" />
            <asp:Parameter Name="Original_LinkID" Type="Int32" />
        </UpdateParameters>
        <SelectParameters>
 
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="MerchName" Type="String" />
            <asp:Parameter Name="MerchDescr" Type="String" />
            <asp:Parameter Name="BannerCode" Type="String" />
            <asp:Parameter Name="BannerImagePath" Type="String" />
            <asp:Parameter Name="TextLinkCode" Type="String" />
            <asp:Parameter Name="TextLinkText" Type="String" />
            <asp:Parameter Name="MerchSource" Type="String" />
            <asp:Parameter Name="IsFree" Type="Boolean" />
            <asp:Parameter Name="IsFeatured" Type="Boolean" />
            <asp:Parameter Name="Keywords" Type="String" />
            <asp:Parameter Name="CommPct" Type="Decimal" />
            <asp:Parameter Name="CommPerClick" Type="Decimal" />
            <asp:Parameter Name="CommPerSale" Type="Decimal" />
            <asp:Parameter Name="SiteURL" Type="String" />
            <asp:Parameter Name="SEKeywords" Type="String" />
            <asp:Parameter Name="SEName" Type="String" />
            <asp:Parameter Name="SETitle" Type="String" />
            <asp:Parameter Name="SEDescr" Type="String" />
            <asp:Parameter Name="SENoScript" Type="String" />
            <asp:Parameter Name="SEAltText" Type="String" />
            <asp:Parameter Name="Published" Type="Boolean" />
            <asp:Parameter Name="Deleted" Type="Boolean" />
            <asp:Parameter Name="CssClassName" Type="String" />
            <asp:Parameter Name="CssClassTextLinkText" Type="String" />
            <asp:Parameter Name="CssClassMerchDescr" Type="String" />
            <asp:Parameter Name="DisplayOrder" Type="Int32" />
        </InsertParameters>
    </asp:ObjectDataSource>

Open in new window

0
 
LVL 13

Expert Comment

by:drypz
ID: 24769329
0
 

Accepted Solution

by:
bd9000 earned 0 total points
ID: 24810536
I created my own class for this.  ODS does not support datasets created from the wizard (as far as I can tell).
so much for Rapid Application Development. MS VS Developers need to get a clue.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question