开发者

ASP.net objectDataSource

开发者 https://www.devze.com 2023-01-20 08:09 出处:网络
Isitpossible tokeepthe same Method name forbothinsertandupdate inObjectDatasource? IamusingSave() method for insertand update.But O开发者_Python百科bjectDataSourcefires Updatebut does not

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

精彩评论

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