corelibraries-devexpress-dot-dataaccess-dot-excel-dot-exceldatasource.md
Gets or sets a path to the Microsoft Excel workbook or CSV file.
Namespace : DevExpress.DataAccess.Excel
Assembly : DevExpress.DataAccess.v25.2.dll
NuGet Package : DevExpress.DataAccess
[DefaultValue(null)]
[LocalizableCategory(DataAccessStringId.PropertyGridDataCategoryName)]
public string FileName { get; set; }
<DefaultValue(Nothing)>
<LocalizableCategory(DataAccessStringId.PropertyGridDataCategoryName)>
Public Property FileName As String
| Type | Default | Description |
|---|---|---|
| String | null |
A String that specifies the path to the Microsoft Excel workbook or CSV file.
|
As an alternative, you can specify the stream containing a Microsoft Excel workbook or CSV file using the ExcelDataSource.Stream property. Specify the format of the document contained in the stream by using the ExcelDataSource.StreamDocumentFormat 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.
data-access-library-create-data-sources-at-runtime/CS/ExcelDataSourceSnippets/Code.cs#L16
ExcelDataSource excelDataSource = new ExcelDataSource();
excelDataSource.FileName = "Northwind.csv";
winforms-grid-open-excel-files/CS/Form1.cs#L19
var source = new ExcelDataSource();
source.FileName = "test.xls";
var worksheetSettings = new ExcelWorksheetSettings("Sheet1", "A1:B3");
ExcelDataSource excelDataSource = new ExcelDataSource();
excelDataSource.FileName = fileName;
ExcelWorksheetSettings excelWorksheetSettings = new ExcelWorksheetSettings();
reporting-winforms-bind-to-csv-file/CS/BindingReportToCsvFile/Form1.cs#L29
ExcelDataSource excelDataSource = new ExcelDataSource();
excelDataSource.FileName = "..//..//Northwind.csv";
winforms-dashboard-grid-hyperlink-column/CS/Dashboard_GridHyperlinkColumn/Form1.cs#L16
DashboardExcelDataSource excelDataSource = new DashboardExcelDataSource("Excel Data Source");
excelDataSource.FileName = @"..\..\Data\GDPByCountry.xlsx";
excelDataSource.SourceOptions = new ExcelSourceOptions(new ExcelWorksheetSettings("Sheet1"));
data-access-library-create-data-sources-at-runtime/VB/ExcelDataSourceSnippets/Code.vb#L14
Dim excelDataSource As New ExcelDataSource()
excelDataSource.FileName = "Northwind.csv"
winforms-grid-open-excel-files/VB/Form1.vb#L14
Dim source = New ExcelDataSource()
source.FileName = "test.xls"
Dim worksheetSettings = New ExcelWorksheetSettings("Sheet1", "A1:B3")
Dim excelDataSource As ExcelDataSource = New ExcelDataSource()
excelDataSource.FileName = fileName
Dim excelWorksheetSettings As ExcelWorksheetSettings = New ExcelWorksheetSettings()
reporting-winforms-bind-to-csv-file/VB/BindingReportToCsvFile/Form1.vb#L23
Dim excelDataSource As ExcelDataSource = New ExcelDataSource()
excelDataSource.FileName = "..//..//Northwind.csv"
' Specify import settings.
reporting-winforms-bind-excel-runtime/VB/BindingReportToExcelWorkbook/Form1.vb#L22
Dim excelDataSource As ExcelDataSource = New ExcelDataSource()
excelDataSource.FileName = "..//..//Northwind.xlsx"
' Select a required worksheet.
See Also