简体   繁体   English

从C#中的代码隐藏配置ObjectDataSource

[英]configure ObjectDataSource from Code Behind in C#

I have an ObjectDataSource and I want to configure it from code behind , I want to set the InsertMethod , Selectmethod from Code Behind and set it to my Business Layer files 我有一个ObjectDataSource,我想从背后的代码中进行配置,我想从Code Behind中设置InsertMethod,Selectmethod并将其设置为我的业务层文件

Please help me as soon as you can 请尽快帮助我

Thanks in Advance 提前致谢

In your code behind, you can assign the SelectMethod and InsertMethod like this: 在后面的代码中,您可以像下面这样分配SelectMethod和InsertMethod:

this.ObjectDataSource1.TypeName = "NamespaceName.ClassName";
this.ObjectDataSource1.SelectMethod = "SelectMethodName";
this.ObjectDataSource1.InsertMethod = "InsertMethodName";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM