Search Results for

    Show / Hide Table of Contents

    Class CsvDataConnection

    Represents a connection to csv file-based database.

    Inheritance
    System.Object
    Base
    DataComponentBase
    DataConnectionBase
    CsvDataConnection
    Implements
    IFRSerializable
    IParent
    Inherited Members
    DataConnectionBase.DataSet
    DataConnectionBase.Tables
    DataConnectionBase.ConnectionString
    DataConnectionBase.ConnectionStringExpression
    DataConnectionBase.IsSqlBased
    DataConnectionBase.CanContainProcedures
    DataConnectionBase.LoginPrompt
    DataConnectionBase.CommandTimeout
    DataConnectionBase.PrepareSelectCommand(String, String, DbConnection)
    DataConnectionBase.FindTableDataSource(DataTable)
    DataConnectionBase.Dispose(Boolean)
    DataConnectionBase.DisposeDataSet()
    DataConnectionBase.GetConnectionStringWithLoginInfo(String, String)
    DataConnectionBase.CanContain(Base)
    DataConnectionBase.GetChildObjects(ObjectCollection)
    DataConnectionBase.AddChild(Base)
    DataConnectionBase.RemoveChild(Base)
    DataConnectionBase.GetChildOrder(Base)
    DataConnectionBase.SetChildOrder(Base, Int32)
    DataConnectionBase.UpdateLayout(Single, Single)
    DataConnectionBase.CreateAllTables()
    DataConnectionBase.CreateAllTables(Boolean)
    DataConnectionBase.CreateAllProcedures()
    DataConnectionBase.CreateProcedure(String)
    DataConnectionBase.CreateRelations()
    DataConnectionBase.GetProcedureNames()
    DataConnectionBase.GetConnectionType()
    DataConnectionBase.GetConnection()
    DataConnectionBase.OpenConnection(DbConnection)
    DataConnectionBase.DisposeConnection(DbConnection)
    DataConnectionBase.GetAdapter(String, DbConnection, CommandParameterCollection)
    DataConnectionBase.GetParameterType()
    DataConnectionBase.Clone()
    DataConnectionBase.CreateUniqueNames(DataConnectionBase)
    DataConnectionBase.Serialize(FRWriter)
    DataConnectionBase.GetExpressions()
    DataComponentBase.Alias
    DataComponentBase.Enabled
    DataComponentBase.ReferenceName
    DataComponentBase.Reference
    DataComponentBase.IsAliased
    DataComponentBase.Assign(Base)
    DataComponentBase.SetName(String)
    DataComponentBase.InitializeComponent()
    Base.Name
    Base.Restrictions
    Base.Flags
    Base.Parent
    Base.BaseName
    Base.ClassName
    Base.Report
    Base.Page
    Base.ChildObjects
    Base.AllObjects
    Base.ZOrder
    Base.IsAncestor
    Base.IsDesigning
    Base.IsPrinting
    Base.IsRunning
    Base.OriginalComponent
    Base.Disposed
    Base.SetProp(Base, Base)
    Base.FloatDiff(Single, Single)
    Base.DeserializeSubItems(FRReader)
    Base.ExtractDefaultMacros(String)
    Base.Dispose()
    Base.SetFlags(Flags, Boolean)
    Base.SetReport(Report)
    Base.SetParent(Base)
    Base.SetParentCore(Base)
    Base.FindObject(String)
    Base.CreateUniqueName()
    Base.Clear()
    Base.Deserialize(FRReader)
    Base.BaseAssign(Base)
    Base.AssignAll(Base)
    Base.HasParent(Base)
    Base.HasFlag(Flags)
    Base.HasRestriction(Restrictions)
    Base.InvokeEvent(String, Object)
    Base.OnAfterLoad()
    Base.GetCustomScript()
    Base.ExtractMacros()
    Base.IsHaveToConvert(Object)
    Base.GetConvertedObjects()
    Base.ForEachAllConvectedObjects(Object)
    Namespace: FastReport.Data
    Assembly: FastReport.Base.dll
    Syntax
    public class CsvDataConnection : DataConnectionBase, IDisposable, IFRSerializable, IParent
    Examples

    This example shows how to add a new connection to the report.

    Report report1;
    CsvDataConnection conn = new CsvDataConnection();
    conn.CsvFile = @"c:\data.csv";
    report1.Dictionary.Connections.Add(conn);
    conn.CreateAllTables();

    Constructors

    CsvDataConnection()

    Initializes a new instance of the CsvDataConnection class.

    Declaration
    public CsvDataConnection()

    Properties

    Codepage

    Gets or sets the codepage of the .csv file.

    Declaration
    public int Codepage { get; set; }
    Property Value
    Type Description
    System.Int32

    ConvertFieldTypes

    Gets or sets the value indicating that field types fhould be converted.

    Declaration
    public bool ConvertFieldTypes { get; set; }
    Property Value
    Type Description
    System.Boolean

    CsvFile

    Gets or sets the path to .csv file.

    Declaration
    public string CsvFile { get; set; }
    Property Value
    Type Description
    System.String

    CurrencyFormat

    Gets or sets locale name used to auto-convert currency fields, e.g. "en-US".

    Declaration
    public string CurrencyFormat { get; set; }
    Property Value
    Type Description
    System.String

    DateTimeFormat

    Gets or sets locale name used to auto-convert datetime fields, e.g. "en-US".

    Declaration
    public string DateTimeFormat { get; set; }
    Property Value
    Type Description
    System.String

    FieldNamesInFirstString

    Gets or sets the value indicating that field names should be loaded from the first string of the file.

    Declaration
    public bool FieldNamesInFirstString { get; set; }
    Property Value
    Type Description
    System.Boolean

    NumberFormat

    Gets or sets locale name used to auto-convert numeric fields, e.g. "en-US".

    Declaration
    public string NumberFormat { get; set; }
    Property Value
    Type Description
    System.String

    RemoveQuotationMarks

    Gets or sets the value indicating that quotation marks should be removed.

    Declaration
    public bool RemoveQuotationMarks { get; set; }
    Property Value
    Type Description
    System.Boolean

    Separator

    Gets or sets the separator of the .csv file.

    Declaration
    public string Separator { 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
    DataConnectionBase.CreateDataSet()
    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
    DataConnectionBase.CreateTable(TableDataSource)

    DeleteTable(TableDataSource)

    Deletes table. For internal use only.

    Declaration
    public override void DeleteTable(TableDataSource source)
    Parameters
    Type Name Description
    TableDataSource source
    Overrides
    DataConnectionBase.DeleteTable(TableDataSource)

    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
    DataConnectionBase.FillTableData(DataTable, String, CommandParameterCollection)
    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
    DataConnectionBase.FillTableSchema(DataTable, String, CommandParameterCollection)
    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.

    GetTableNames()

    Gets an array of table names available in the database.

    Declaration
    public override string[] GetTableNames()
    Returns
    Type Description
    System.String[]

    An array of strings.

    Overrides
    DataConnectionBase.GetTableNames()

    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
    DataConnectionBase.QuoteIdentifier(String, DbConnection)

    RelatedPathCheck(CsvConnectionStringBuilder)

    Checking a relative path relative to a file

    Declaration
    protected void RelatedPathCheck(CsvConnectionStringBuilder builder)
    Parameters
    Type Name Description
    CsvConnectionStringBuilder builder

    SetConnectionString(String)

    Sets the connection string.

    Declaration
    protected override void SetConnectionString(string value)
    Parameters
    Type Name Description
    System.String value

    New connection string.

    Overrides
    DataConnectionBase.SetConnectionString(String)
    Remarks

    Use this method if you need to perform some actions when the connection string is set.

    Implements

    IFRSerializable
    IParent
    Back to top © 1998-2025 Copyright Fast Reports Inc.