DataSources.Item 属性

获取指定索引处的对象。在 C# 中,此属性是 DataSourceRef 类的索引器。

命名空间 CrystalDecisions.Web 程序集 CrystalDecisions.Web (CrystalDecisions.Web.dll)

语法

声明

Public Overrideable Property Item ( _
    ByVal index As Integer _    
) As CrystalDecisions.Web.DataSourceRef
public virtual CrystalDecisions.Web.DataSourceRef this [
    int index
]{get; set;}

参数

  • index

属性值

集合中指定索引处的值。

备注

此属性允许您访问集合中的特定项目。使用从零开始的数值索引来引用项目。

C# 中不存在属性名称 Item。要使用 C# 访问集合中的项目,请使用语法:collection[0]

示例

此示例显示如何从 DataSources 对象中获取 DataSourceRef 对象。

声明

    Private Function GetDataSourceRef(ByVal myDataSources As DataSources, ByVal myIndex As Integer) _
            As DataSourceRef
        GetDataSourceRef = myDataSources.Item(myIndex)
    End Function
    private DataSourceRef GetDataSourceRef(DataSources dataSources, int index)
    {
        return dataSources[index];
    }

版本信息

Crystal Reports Basic for Visual Studio 2008

从此版本开始支持: Crystal Reports for Visual Studio 2005

另请参见

引用

DataSources 类
DataSources 成员
CrystalDecisions.Web 命名空间