0

如何绑定详细信息视图并返回一个类对象?

Dim _obj As New NewRequestDetailsBL

_obj = NewRequestDetailsBL.SelectRequestDetails(Session("requestid"), 
Session("contactid"))
dvAdmin1.DataSource = _obj ' this line is giving the error
dvAdmin1.DataBind()

错误:

System.InvalidOperationException: Data source is an invalid type.  
It must be either  an IListSource, IEnumerable, or IDataSource.
4

1 回答 1

1

该错误包含您需要的所有信息!

它必须是IListSourceIEnumerableIDataSource

您的类必须至少实现其中一个接口,然后您才能设置DataSourceNewRequestDetailsBL类的实例。

于 2013-02-22T20:24:58.817 回答