Share via


InvalidDataSourceReference Class

Definition

Represents a state in which a data source reference is no longer valid.

public ref class InvalidDataSourceReference : ReportService2005::DataSourceDefinitionOrReference
public class InvalidDataSourceReference : ReportService2005.DataSourceDefinitionOrReference
type InvalidDataSourceReference = class
    inherit DataSourceDefinitionOrReference
Public Class InvalidDataSourceReference
Inherits DataSourceDefinitionOrReference
Inheritance
InvalidDataSourceReference

Remarks

An InvalidDataSourceReference object is used with the Item property as output by GetItemDataSources method.

In most cases, an InvalidDataSourceReference object is returned when a shared data source has been deleted.

To evaluate whether a data source reference is valid, use the is keyword in C# (TypeOf/Is in Visual Basic) to determine the type of object returned by the Item property of the DataSource class, as shown in the following C# code:

DataSource[] dataSource;  
dataSource = service.GetReportDataSources( "/MyReport" );  

foreach ( DataSource ds in dataSource )  
{  
    if ( ds.Item is InvalidDataSourceReference )  
    {  
        // Code to handle a corrupt or missing data source reference goes here...  
    }  
}  

Constructors

InvalidDataSourceReference()

Initializes a new instance of the InvalidDataSourceReference class.

Applies to