Class XmlDataConnection
Represents a connection to xml file-based database.
Inherited Members
Namespace: FastReport.Data
Assembly: FastReport.OpenSource.dll
Syntax
public class XmlDataConnection : DataConnectionBase, IFRSerializable, IParent
Examples
This example shows how to add a new connection to the report.
Report report1;
XmlDataConnection conn = new XmlDataConnection();
conn.XmlFile = @"c:\data.xml";
report1.Dictionary.Connections.Add(conn);
conn.CreateAllTables();
Constructors
XmlDataConnection()
Initializes a new instance of the XmlDataConnection class with default settings.
Declaration
public XmlDataConnection()
Properties
XmlFile
Gets or sets the path to .xml file.
Declaration
public string XmlFile { get; set; }
Property Value
Type | Description |
---|---|
System.String |
XsdFile
Gets or sets the path to .xsd file.
Declaration
public string XsdFile { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
CreateDataSet()
Initializes a DataSet instance.
Declaration
protected override DataSet CreateDataSet()
Returns
Type | Description |
---|---|
DataSet | The DataSet object. |
Overrides
Remarks
This method is used to support FastReport infrastructure. You don't need to use it.
CreateTable(TableDataSource)
Creates table. For internal use only.
Declaration
public override void CreateTable(TableDataSource source)
Parameters
Type | Name | Description |
---|---|---|
TableDataSource | source |
Overrides
DeleteTable(TableDataSource)
Deletes table. For internal use only.
Declaration
public override void DeleteTable(TableDataSource source)
Parameters
Type | Name | Description |
---|---|---|
TableDataSource | source |
Overrides
FillTableData(DataTable, String, CommandParameterCollection)
Fills the table data.
Declaration
public override void FillTableData(DataTable table, string selectCommand, CommandParameterCollection parameters)
Parameters
Type | Name | Description |
---|---|---|
DataTable | table | DataTable to fill. |
System.String | selectCommand | The SQL select command. |
CommandParameterCollection | parameters | SQL parameters. |
Overrides
Remarks
Usually you don't need to use this method. Internally it uses the GetConnection() and GetAdapter(String, DbConnection, CommandParameterCollection) methods to fill the table data. If you create own connection component that does not use nor connection or adapter, then you need to override this method.
FillTableSchema(DataTable, String, CommandParameterCollection)
Fills the table schema.
Declaration
public override void FillTableSchema(DataTable table, string selectCommand, CommandParameterCollection parameters)
Parameters
Type | Name | Description |
---|---|---|
DataTable | table | DataTable to fill. |
System.String | selectCommand | The SQL select command. |
CommandParameterCollection | parameters | SQL parameters. |
Overrides
Remarks
Usually you don't need to use this method. Internally it uses the GetConnection() and GetAdapter(String, DbConnection, CommandParameterCollection) methods to fill the table schema. If you create own connection component that does not use nor connection or adapter, then you need to override this method.
QuoteIdentifier(String, DbConnection)
Quotes the specified DB identifier such as table name or column name.
Declaration
public override string QuoteIdentifier(string value, DbConnection connection)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | Identifier to quote. |
DbConnection | connection | The opened DB connection. |
Returns
Type | Description |
---|---|
System.String | The quoted identifier. |
Overrides
SetConnectionString(String)
Sets the connection string.
Declaration
protected override void SetConnectionString(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | New connection string. |
Overrides
Remarks
Use this method if you need to perform some actions when the connection string is set.