Back to Devexpress

FileConnectionParametersBase.FileName Property

corelibraries-devexpress-dot-dataaccess-dot-connectionparameters-dot-fileconnectionparametersbase.md

latest6.6 KB
Original Source

FileConnectionParametersBase.FileName Property

Gets or sets the path to a database file.

Namespace : DevExpress.DataAccess.ConnectionParameters

Assembly : DevExpress.DataAccess.v25.2.dll

NuGet Package : DevExpress.DataAccess

Declaration

csharp
public string FileName { get; set; }
vb
Public Property FileName As String

Property Value

TypeDescription
String

A String that specifies the path to a database file.

|

Remarks

If the database file is protected with a password, specify this password via the FileConnectionParametersBase.Password property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the FileName property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-save-restore-dashboard-state/CS/WinFormsDashboard_DashboardState/Form1.cs#L98

csharp
if (e.DataSourceName == "SalesPerson")
        ((ExcelDataSourceConnectionParameters)e.ConnectionParameters).FileName = @"Data\SalesPerson.xlsx";
}

winforms-dashboard-data-federation/CS/DataFederationExample/Form1.cs#L164

csharp
SQLiteConnectionParameters sqliteParams = new SQLiteConnectionParameters();
sqliteParams.FileName = @"Data\nwind.db";

asp-net-core-dashboard-save-dashboard-state-to-cookies/CS/WebDashboardAspNetCore/Code/DashboardUtils.cs#L39

csharp
SQLiteConnectionParameters sqliteParams = new SQLiteConnectionParameters();
sqliteParams.FileName = "Data/nwind.db";
e.ConnectionParameters = sqliteParams;

asp-net-core-dashboard-custom-interactivity/CS/AspNetCoreDashboard_CustomInteractivity/Code/DashboardUtils.cs#L50

csharp
ExcelDataSourceConnectionParameters excelParameters = (ExcelDataSourceConnectionParameters)e.ConnectionParameters;
    excelParameters.FileName = fileProvider.GetFileInfo("Data/Sales.xlsx").PhysicalPath;
}

aspnet-core-dashboard-specify-default-state-in-code/CS/AspNetCoreDashboardState/Startup.cs#L44

csharp
SQLiteConnectionParameters sqliteParams = new SQLiteConnectionParameters();
sqliteParams.FileName = "file:Data/nwind.db";
e.ConnectionParameters = sqliteParams;

winforms-dashboard-save-restore-dashboard-state/VB/WinFormsDashboard_DashboardState/Form1.vb#L75

vb
If e.DataSourceName = "SalesPerson" Then
    CType(e.ConnectionParameters, ExcelDataSourceConnectionParameters).FileName = "Data\SalesPerson.xlsx"
End If

winforms-dashboard-data-federation/VB/DataFederationExample/Form1.vb#L153

vb
Dim sqliteParams As New SQLiteConnectionParameters()
sqliteParams.FileName = "Data\nwind.db"

web-forms-dashboard-save-dashboards-title-as-file-name/VB/DXWebApplication2/Default.aspx.vb#L45

vb
Dim excelParameters As ExcelDataSourceConnectionParameters = CType(e.ConnectionParameters, ExcelDataSourceConnectionParameters)
    excelParameters.FileName = HostingEnvironment.MapPath("~/App_Data/Sales.xlsx")
End If

web-forms-dashboard-save-dashboards-to-database/VB/Global.asax.vb#L34

vb
Dim accessParams As New Access97ConnectionParameters()
accessParams.FileName = HostingEnvironment.MapPath("~/App_Data/nwind.mdb")
e.ConnectionParameters = accessParams

web-forms-dashboard-add-custom-information-to-exported-dashboard/VB/WebDashboard_CustomExport/Default.aspx.vb#L30

vb
Dim access97Params As New Access97ConnectionParameters()
access97Params.FileName = HostingEnvironment.MapPath("~/App_Data/nwind.mdb")
e.ConnectionParameters = access97Params

See Also

Password

FileConnectionParametersBase Class

FileConnectionParametersBase Members

DevExpress.DataAccess.ConnectionParameters Namespace