Reports for WPF | ComponentOne
C1.C1Report Namespace / DataSource Class / ConnectionString Property

In This Topic
    ConnectionString Property (DataSource)
    In This Topic
    Gets or sets the string used to open a database.
    Syntax
    'Declaration
     
    Public Property ConnectionString As String
    public string ConnectionString {get; set;}
    Remarks

    The DataSource.ConnectionString is used by the DataSource class to load the report data.

    The DataSource class uses an System.Data.OleDb.OleDbConnection object to retrieve the data, so the syntax for the DataSource.ConnectionString is the one used OleDb connection strings. For details on the syntax, see the documentation for the System.Data.OleDb.OleDbConnection class.

    The DataSource.ConnectionString specifies the database that contains the report data. The DataSource.RecordSource property specifies which table, stored procedure, or Sql command to use for retrieving the data.

    If you want to use a different type of connection (e.g. a System.Data.SqlClient.SqlConnection, or if your application already has the data available in a System.Data.DataTable object, you can assign the data directly to the DataSource.Recordset property.

    See Also