ActiveReports 14 .NET Edition
GrapeCity.ActiveReports Assembly / GrapeCity.ActiveReports.Data Namespace / OleDBDataSource Class / SQL Property

In This Topic
    SQL Property (OleDBDataSource)
    In This Topic
    Specifies a valid SQL statement used to retrieve records from the data source.
    Public Property SQL As String
    public string SQL {get; set;}

    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.

    private void detail1_Format(object sender, System.EventArgs eArgs)
        rptSubBM rpt = new rptSubBM();    
        GrapeCity.ActiveReports.Data.OleDBDataSource subDS = new GrapeCity.ActiveReports.Data.OleDBDataSource();    
        subDS.ConnectionString = ((GrapeCity.ActiveReports.Data.OleDBDataSource)(this.DataSource)).ConnectionString;    
        subDS.SQL = "Select * from products where categoryID = " + m_categoryID;    
        rpt.DataSource = subDS;    
        ctlSubReport.Report = rpt;
    Private Sub Detail1_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles Detail1.Format
        Dim rpt As New rptSubBM()
        Dim subDS As New GrapeCity.ActiveReports.Data.OleDBDataSource()    
        subDS.ConnectionString = CType(Me.DataSource, GrapeCity.ActiveReports.Data.OleDBDataSource).ConnectionString    
        subDS.SQL = "Select * from products where categoryID = " + m_categoryID    rpt.DataSource = subDS    
        Me.ctlSubreport.Report = rpt 
    End Sub
    See Also