如何从自定义控件中的ObjectDataSource获取数据 [英] How to get the data from an ObjectDataSource in a custom control

查看:69
本文介绍了如何从自定义控件中的ObjectDataSource获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有一个ObjectDataSource,它有一个简单的

字符串数组作为business-object。没问题。


我有一个自己的(自定义)控件,我给DataSourceId和

自定义控件,所以我得到了ObjectDataSource。没问题


.....

ObjectDataSource src = .... //没关系我有它

现在我想要


foreach(.....行......在src中的数据列表中)


渲染行。

但我不知道如何获取

ObjectDataSource对象的数据行。


任何帮助都会是很好。


谢谢


Rolf Welskes

解决方案

Hello Rolf,


请您使用如何定义业务对象的类,

这可以帮助我们找到一个将字符串项循环到其中的方法。


真诚的,


Luke Zhang


Microsoft在线社区支持

======================================= ===========

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========


此帖子按原样提供。没有保证,也没有授予任何权利。




你好罗尔夫,


感谢您的发布。


从您的帖子中,我对此问题的理解是:列出行/
ObjectDataSource中列出的数据。如果我不在基地,请随时告诉我。


请一瞥ObjectDataSource:
http://msdn2.microsoft.com/en-us/library/9a4kyhcx.aspx


ObjectDataSource不是那种用法。


此致,

Justin Huang

微软在线社区支持


================================== ================

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


对于新闻组,MSDN订阅者享受无限制的免费支持

到有限数量的基于电话的技术支持事件。复杂的

问题或服务器关闭情况不建议用于新闻组。

使用Microsoft支持时最好处理这种性质的问题

工程师使用您的一个基于电话的事件。

================================ ==================


此帖子按原样提供。没有保证,也没有赋予任何权利。


--------------------

|来自:Rolf Welskes < ro ** @ nospam.nospam>

|主题:如何从自定义控件中的ObjectDataSource获取数据

|日期:2006年10月3日星期二22:22:06 +0200

|行数:29

| X-Priority:3

| X-MSMail-Priority:正常

| X-Newsreader:Microsoft Outlook Express 6.00.2900.2180

| X-RFC2646:格式=流动;原价

| X-MimeOLE:微软MimeOLE制作V6.00.2900.2180

|消息ID:< uc ************** @ TK2MSFTNGP06.phx.gbl>

|新闻组:microsoft.public.dotnet.framework.aspnet

| NNTP-Posting-Host:p5090F901.dip.t-dialin.net 80.144.249.1

|路径:TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFT NGP06.phx.gbl

|外翻:TK2MSFTNGXA01.phx.gbl

microsoft.public.dotnet.framework.aspnet:422396

| X-Tomcat-NG:microsoft.public.dotnet.framework.aspnet

|

|你好,

|我有一个ObjectDataSource,它具有作为业务对象的简单数组

|字符串。没问题。

|

|我有一个自己的(自定义)控件,我给它DataSourceId和



|自定义控件所以我得到了ObjectDataSource。没问题

|

| ....

| ObjectDataSource src = .... //好吧我有它

|

|

|现在我想要

|

| foreach(.....行......在src的数据列表中)

|

|渲染行。

|

|

|但我不知道如何获取

|的数据行ObjectDataSource-object。

|

|任何帮助都没关系。

|

|谢谢

|

| Rolf Welskes

|

|

|

|


您好,

感谢您的回答。


如果我可以列出ObjectDataSource中的数据,我可以开发所有

其他。


您可以看到任何简单的业务对象作为数据持有者

例如

[DataObject(true)]

公共类DataObjCls01

{

string [] datas01 = new string [] {" Müller,Meyer,Schulze和Schulze。 };


public DataObjCls01()

{

}


[DataObjectMethod (DataObjectMethodType.Select)]

public string [] GetDatas01()

{

返回datas01;

}


}


所以我需要对自定义控件中的数据进行原始访问。


谢谢你,最诚挚的问候

Rolf Welskes

" Justin Huang" < i - ****** @ online.microsoft.comschrieb im Newsbeitrag

新闻:Bx ************** @ TK2MSFTNGXA01.phx.gbl。 ..


>

你好罗尔夫,


感谢你发帖。


从您的帖子中,我对此问题的理解是:列出行/
ObjectDataSource中列出的数据。如果我不在基地,请随时告诉我。


请一瞥ObjectDataSource:
http://msdn2.microsoft.com/en-us/library/9a4kyhcx.aspx


ObjectDataSource不是那种用法。


此致,

Justin Huang

微软在线社区支持


================================== ================

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


对于新闻组,MSDN订阅者享受无限制的免费支持

到有限数量的基于电话的技术支持事件。复杂的

问题或服务器关闭情况不建议用于新闻组。

使用Microsoft支持时最好处理这种性质的问题

工程师使用您的一个基于电话的事件。

================================ ==================


此帖子按原样提供。没有保证,也没有赋予

权利。


--------------------

|来自:Rolf Welskes < ro ** @ nospam.nospam>

|主题:如何从自定义的

控件中获取ObjectDataSource的数据

|日期:2006年10月3日星期二22:22:06 +0200

|行数:29

| X-Priority:3

| X-MSMail-Priority:正常

| X-Newsreader:Microsoft Outlook Express 6.00.2900.2180

| X-RFC2646:格式=流动;原价

| X-MimeOLE:微软MimeOLE制作V6.00.2900.2180

|消息ID:< uc ************** @ TK2MSFTNGP06.phx.gbl>

|新闻组:microsoft.public.dotnet.framework.aspnet

| NNTP-Posting-Host:p5090F901.dip.t-dialin.net 80.144.249.1

|路径:TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFT NGP06.phx.gbl

|外翻:TK2MSFTNGXA01.phx.gbl

microsoft.public.dotnet.framework.aspnet:422396

| X-Tomcat-NG:microsoft.public.dotnet.framework.aspnet

|

|你好,

|我有一个ObjectDataSource,它有一个简单的数组作为业务对象



|字符串。没问题。

|

|我有一个自己的(自定义)控件,我给它DataSourceId和



|自定义控件所以我得到了ObjectDataSource。没问题

|

| ....

| ObjectDataSource src = .... //好吧我有它

|

|

|现在我想要

|

| foreach(.....行......在src的数据列表中)

|

|渲染行。

|

|

|但我不知道如何获取

|的数据行ObjectDataSource-object。

|

|任何帮助都没关系。

|

|谢谢

|

| Rolf Welskes

|

|

|

|



Hello,
I have an ObjectDataSource which has as business-object a simple array of
strings. No problem.

I have an own (custom) control to which I give the DataSourceId and in the
custom-control so I get the ObjectDataSource. No problem

.....
ObjectDataSource src = .... //is ok i have it
Now I want

foreach(..... row .... in the list of data in src)

render the row .
but I do not know how to get the rows of data of the
ObjectDataSource-object.

Any help would be fine.

Thank you

Rolf Welskes

解决方案

Hello Rolf,

Would you please show use how you define the class for the business-object,
this may help us find a way to loop the string item in it.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.



Hello Rolf,

Thank you for posting.

From your post, my understanding on this issue is:List Rows data listed in
ObjectDataSource. If I''m off base, please feel free to let me know.

Please take a glance about the ObjectDataSource:
http://msdn2.microsoft.com/en-us/library/9a4kyhcx.aspx

ObjectDataSource is not of that usage.

Sincerely,
Justin Huang
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Rolf Welskes" <ro**@nospam.nospam>
| Subject: How to get the data from an ObjectDataSource in a custom control
| Date: Tue, 3 Oct 2006 22:22:06 +0200
| Lines: 29
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <uc**************@TK2MSFTNGP06.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: p5090F901.dip.t-dialin.net 80.144.249.1
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFT NGP06.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:422396
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello,
| I have an ObjectDataSource which has as business-object a simple array of
| strings. No problem.
|
| I have an own (custom) control to which I give the DataSourceId and in
the
| custom-control so I get the ObjectDataSource. No problem
|
| ....
| ObjectDataSource src = .... //is ok i have it
|
|
| Now I want
|
| foreach(..... row .... in the list of data in src)
|
| render the row .
|
|
| but I do not know how to get the rows of data of the
| ObjectDataSource-object.
|
| Any help would be fine.
|
| Thank you
|
| Rolf Welskes
|
|
|
|


Hello,
thank you for your answer.

right if I could list the data in an ObjectDataSource, I could develop all
other.

You can see any simple business-object as the holder of the data
for example
[DataObject(true)]
public class DataObjCls01
{
string[] datas01 = new string[] { "Müller", "Meyer", "Schulze" };

public DataObjCls01()
{
}

[DataObjectMethod(DataObjectMethodType.Select)]
public string[] GetDatas01()
{
return datas01;
}

}

So I need the prinzipial access to the data in a custom control.

Thank you and best regards
Rolf Welskes
"Justin Huang" <i-******@online.microsoft.comschrieb im Newsbeitrag
news:Bx**************@TK2MSFTNGXA01.phx.gbl...

>
Hello Rolf,

Thank you for posting.

From your post, my understanding on this issue is:List Rows data listed in
ObjectDataSource. If I''m off base, please feel free to let me know.

Please take a glance about the ObjectDataSource:
http://msdn2.microsoft.com/en-us/library/9a4kyhcx.aspx

ObjectDataSource is not of that usage.

Sincerely,
Justin Huang
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
| From: "Rolf Welskes" <ro**@nospam.nospam>
| Subject: How to get the data from an ObjectDataSource in a custom
control
| Date: Tue, 3 Oct 2006 22:22:06 +0200
| Lines: 29
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <uc**************@TK2MSFTNGP06.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: p5090F901.dip.t-dialin.net 80.144.249.1
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFT NGP06.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:422396
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello,
| I have an ObjectDataSource which has as business-object a simple array
of
| strings. No problem.
|
| I have an own (custom) control to which I give the DataSourceId and in
the
| custom-control so I get the ObjectDataSource. No problem
|
| ....
| ObjectDataSource src = .... //is ok i have it
|
|
| Now I want
|
| foreach(..... row .... in the list of data in src)
|
| render the row .
|
|
| but I do not know how to get the rows of data of the
| ObjectDataSource-object.
|
| Any help would be fine.
|
| Thank you
|
| Rolf Welskes
|
|
|
|



这篇关于如何从自定义控件中的ObjectDataSource获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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