Assembly: C1.C1Report.2 (in C1.C1Report.2.dll)
Syntax
C# |
---|
[BrowsableAttribute(false)] [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)] public string ConnectionString { get; set; } |
Visual Basic |
---|
<BrowsableAttribute(False)> _ <DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)> _ Public Property ConnectionString As String Get Set |
Remarks
The ConnectionString is used by the DataSource class to load the report data.
The DataSource class uses an OleDbConnection object to retrieve the data, so the syntax for the ConnectionString is the one used OleDb connection strings. For details on the syntax, see the documentation for the OleDbConnection class.
The ConnectionString specifies the database that contains the report data. The 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 SqlConnection, or if your application already has the data available in a DataTable object, you can assign the data directly to the Recordset property.
Examples
The following code sets up the DataSource object to retrieve the data that you want from the NorthWind database. This is done using the ConnectionString and RecordSource properties (similar to the Microsoft ADO DataControl):
' initialize DataSource With c1r.DataSource .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= C:\Program Files\ComponentOne Studio.NET 2.0\Common\Nwind.mdb;" & "Persist Security Info=False" .RecordSource = "Employees" End With |
// initialize DataSource c1r.DataSource.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source= C:\Program Files\ComponentOne Studio.NET 2.0\Common\Nwind.mdb;" + "Persist Security Info=false"; c1r.DataSource.RecordSource = "Employees"; |
For an example using the ConnectionString property, see the Creating a Report Definition topic.