开发者

ASP.net objectDataSource

Is it possible to keep the same Method name for both insert and update in ObjectDatasource?

I am using Save() method for insert and update.But O开发者_Python百科bjectDataSource fires Update but does not fire insert.


Yes, this is possible. If you set the InsertMethod and UpdateMethod to the same routines, this should work fine.

<asp:ObjectDataSource ID="CustomerInfoDataSource" runat="server" DataObjectTypeName="Entities.CustomerInfo"
    InsertMethod="Save" SelectMethod="GetByCustomerId" TypeName="Business.CustomerManager"
    UpdateMethod="Save">

Hope this helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜