See Also

OleDBDataSource Class  | OleDBDataSource Members  | Parameters class  | Parameter class  | Parameters property

Language

Visual Basic

C#

Show All

See Also Languages ActiveReports Send feedback to Data Dynamics

SQL Property

Specifies a valid SQL statement used to retrieve records from the data source.

[Visual Basic]
Public Property SQL As String
[C#]
public string SQL {get; set;}

Remarks

ActiveReports creates a DataReader and uses it to load the data into the report.

The SQL string may contain parameter placeholder syntax to fill the report's parameters collection and prompt the user to enter their values before executing the report.

Example

[C#] 

private void Detail_Format(object sender, System.EventArgs eArgs) 
{     
    rptSub rpt = new rptSubBM();     
    DataDynamics.ActiveReports.DataSources.OleDBDataSource subDS = new DataDynamics.         
        ActiveReports.DataSources.OleDBDataSource();     
    subDS.ConnectionString = this.ds.ConnectionString;     
    subDS.SQL = "Select * from products where categoryID = " + m_categoryID;     
    rpt.DataSource = subDS;     
    ctlSubReport.Report = rpt; 
}

[Visual Basic] 

Private Sub Detail_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles Detail.Format
    Dim rpt As New rptSubBM()
    Dim subDS As New DataDynamics.ActiveReports.DataSources.OleDBDataSource()
    subDS.ConnectionString = Me.ds.ConnectionString
    subDS.SQL = "Select * from products where categoryID = " + m_categoryID rpt.DataSource = subDS
    Me.ctlSubreport.Report = rpt
End Sub

See Also

OleDBDataSource Class  | OleDBDataSource Members  | Parameters class  | Parameter class  | Parameters property

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.