如何绑定详细信息视图并返回类对象?
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.
答案 0 :(得分:1)
错误包含您需要的所有信息!
您的类必须至少实现其中一个接口,然后您才能将DataSource
设置为NewRequestDetailsBL
类的实例。