ServerReport.GetDataSources 메서드
보고서에 사용된 데이터 소스에 대한 정보를 검색합니다.
네임스페이스: Microsoft.Reporting.WebForms
어셈블리: Microsoft.ReportViewer.WebForms(Microsoft.ReportViewer.WebForms.dll)
구문
‘선언
Public Function GetDataSources As ReportDataSourceInfoCollection
‘사용 방법
Dim instance As ServerReport
Dim returnValue As ReportDataSourceInfoCollection
returnValue = instance.GetDataSources()
public ReportDataSourceInfoCollection GetDataSources()
public:
ReportDataSourceInfoCollection^ GetDataSources()
member GetDataSources : unit -> ReportDataSourceInfoCollection
public function GetDataSources() : ReportDataSourceInfoCollection
반환 값
유형: Microsoft.Reporting.WebForms.ReportDataSourceInfoCollection
ReportDataSourceInfo 개체를 포함하는 ReportDataSourceInfoCollection
주의
이 메서드는 자격 증명을 요청할 수 있는 보고서에 사용된 데이터 소스의 데이터 소스 이름과 사용자 프롬프트 문자열을 반환합니다.
예
private void button1_Click(object sender, EventArgs e)
{
ReportDataSourceInfoCollection rdsic =
this.reportViewer1.ServerReport.GetDataSources();
foreach (ReportDataSourceInfo rdsi in rdsic)
{
Debug.WriteLine(rdsi.Name + ":" + rdsi.Prompt);
}
}
Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button2.Click
Dim rdsic As ReportDataSourceInfoCollection = _
ReportViewer1.ServerReport.GetDataSources
For Each rdsi As ReportDataSourceInfo In rdsic
Debug.WriteLine(rdsi.Name + ":" + rdsi.Prompt)
Next
End Sub