从C#中的代码隐藏配置ObjectDataSource [英] configure ObjectDataSource from Code Behind in C#

查看:47
本文介绍了从C#中的代码隐藏配置ObjectDataSource的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ObjectDataSource,我想从后面的代码中配置它,我想从背后的代码中设置InsertMethod和Selectmethod并将其设置为我的业务层文件

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

请尽快帮助我

预先感谢

推荐答案

在后面的代码中,您可以像下面这样分配SelectMethod和InsertMethod:

In your code behind, you can assign the SelectMethod and InsertMethod like this:

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

这篇关于从C#中的代码隐藏配置ObjectDataSource的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆