Back to Devexpress

SqlQuery.Name Property

corelibraries-devexpress-dot-dataaccess-dot-sql-dot-sqlquery-d5f64c17.md

latest6.4 KB
Original Source

SqlQuery.Name Property

Specifies the query name.

Namespace : DevExpress.DataAccess.Sql

Assembly : DevExpress.DataAccess.v25.2.dll

NuGet Package : DevExpress.DataAccess

Declaration

csharp
[DefaultValue("")]
[LocalizableCategory(DataAccessStringId.QueryPropertyGridCommonCategoryName)]
public string Name { get; set; }
vb
<DefaultValue("")>
<LocalizableCategory(DataAccessStringId.QueryPropertyGridCommonCategoryName)>
Public Property Name As String

Property Value

TypeDefaultDescription
StringString.Empty

A String value, specifying the query name.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the Name 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-replace-sql-data-source-with-object-data-source-with-filtered-data/CS/WinFormsDashboard/ViewerForm.cs#L30

csharp
foreach (var query in dataSources.SelectMany(ds => ds.Queries.Select(q => new { DataSource = ds, Query = q }))) {
    var ods = new DashboardObjectDataSource("ods|" + query.DataSource.ComponentName + "|" + query.Query.Name);
    e.Dashboard.DataSources.Add(ods);

web-forms-dashboard-replace-sql-data-source-with-object-data-source-with-filtered-data/CS/ASPxDashboard/Default.aspx.cs#L25

csharp
DashboardSqlDataSource dataSource = dataSources.First(ds => ds.ComponentName == names[1]);
SqlQuery query = dataSource.Queries.First(q => q.Name == names[2]);

reporting-winforms-sql-data-source-runtime/CS/RuntimeSqlDataSourceReportSample/QueryHelper.cs#L22

csharp
.Build("Categories");
query.Name = "Categories with 7 or More Products";
return query;

query-builder-use-in-asp-net-core-application/CS/AspNetCoreQueryBuilderApp/Services/DataSourceStorageService.cs#L25

csharp
if(!string.IsNullOrEmpty(selectQuery.Name)) {
    queryName = selectQuery.Name;

reporting-wpf-create-report-in-code/CS/RuntimeReportsApplication/MainWindow.xaml.cs#L37

csharp
SqlDataSource ds = report.DataSource as SqlDataSource;
CreateDetailReport(report, ds.Queries[0].Name + "." + ds.Relations[0].Name);

winforms-dashboard-replace-sql-data-source-with-object-data-source-with-filtered-data/VB/WinFormsDashboard/ViewerForm.vb#L32

vb
For Each query In dataSources.SelectMany(Function(ds) ds.Queries.Select(Function(q) New With {Key .DataSource = ds, Key .Query = q}))
    Dim ods = New DashboardObjectDataSource("ods|" & query.DataSource.ComponentName & "|" & query.Query.Name)
    e.Dashboard.DataSources.Add(ods)

web-forms-dashboard-replace-sql-data-source-with-object-data-source-with-filtered-data/VB/ASPxDashboard/Default.aspx.vb#L21

vb
Dim dataSource As DashboardSqlDataSource = dataSources.First(Function(ds) ds.ComponentName = names(1))
Dim query As SqlQuery = dataSource.Queries.First(Function(q) q.Name = names(2))

reporting-winforms-sql-data-source-runtime/VB/RuntimeSqlDataSourceReportSample/ReportCreator.vb#L22

vb
report.DataSource = ds
report.DataMember = ds.Queries(0).Name

winforms-dashboard-bind-to-sql-server-database-file/VB/BindToMsSqlDatabaseFileExample/Form1.vb#L23

vb
dataItem.DataSource = dashboardSqlDataSource
    dataItem.DataMember = dashboardSqlDataSource.Queries(0).Name
End If

winforms-grid-create-configure-sql-data-source/VB/dxSample/Form1.vb#L52

vb
Dim query As CustomSqlQuery = New CustomSqlQuery()
query.Name = "customQuery1"
query.Sql = "SELECT * FROM Products"

See Also

SqlQuery Class

SqlQuery Members

DevExpress.DataAccess.Sql Namespace