• Basics
  • Abyss
  • Web APIs
  • C# & Razor
  • .net API
  • JS & TS API

    Show / Hide Table of Contents

    Class DnnSql

    Retrieves data from SQL, specifically using the DNN Connection String

    Data Source: DnnSql

    The DnnSql DataSource is part of the Standard Dnn Data Sources. It lets you use data from the Dnn SQL databases as if they were entities.

    This is what it looks like:

    How to use

    Internally the DnnSqlDataSource is exactly the same as the Sql DataSource just with fewer options, because you cannot choose most of the settings. Please consult the Sql DataSource documentation to see how you can use it.

    We recommend to use the VisualQuery where possible, as it's easier to understand and is identical for C# and JavaScript. It's also better because it separates data-retrieval from visualization.

    Read also

    • DataSource / DataStream
    • List of all EAV Data Sources
    • Query / VisualQuery

    Demo App and further links

    You should find some examples in this demo App

    • Demo App with examples for most DataSources

    History

    1. Introduced in EAV 3.x, in 2sxc ?

    API Documentation

    Inheritance
    System.Object
    ToSic.Lib.Services.ServiceBase
    ToSic.Lib.Services.ServiceBase<ToSic.Eav.DataSource.DataSourceBase.MyServices>
    DataSourceBase
    ToSic.Eav.DataSource.CustomDataSourceAdvanced
    Sql
    DnnSql
    Implements
    IDataSource
    IAppIdentity
    IZoneIdentity
    IAppIdentityLight
    ICacheKey
    ICacheExpiring
    ITimestamped
    IHasLog
    IDataSourceLinkable
    Inherited Members
    Sql.ConnectionStringName
    Sql.ConnectionString
    Sql.SelectCommand
    Sql.ContentType
    Sql.TitleField
    Sql.EntityIdField
    DataSourceBase.AppId
    DataSourceBase.ZoneId
    DataSourceBase.Guid
    DataSourceBase.Error
    DataSourceBase.CacheTimestamp
    DataSourceBase.CacheChanged(Int64)
    DataSourceBase.Configuration
    DataSourceBase.Link
    DataSourceBase.In
    DataSourceBase.TryGetIn(String)
    DataSourceBase.TryGetOut(String)
    DataSourceBase.Out
    DataSourceBase.Item[String]
    DataSourceBase.GetStream(String, String, Boolean, Boolean)
    DataSourceBase.List
    DataSourceBase.Attach(IDataSource)
    DataSourceBase.Attach(String, IDataSource, String)
    DataSourceBase.Attach(String, IDataStream)
    DataSourceBase.ProvideOut(Func<IEnumerable<IEntity>>, String)
    DataSourceBase.ProvideOut(Func<IImmutableList<IEntity>>, String)
    Namespace: ToSic.Sxc.Dnn.DataSources
    Assembly: ToSic.Sxc.Dnn.Core.dll
    Syntax
    [PublicApi_Stable_ForUseInYourCode]
    [VisualQuery(NiceName = "Dnn SQL", UiHint = "Data from the Dnn database", Icon = "dynamic_form", Type = DataSourceType.Source, NameId = "ToSic.Sxc.Dnn.DataSources.DnnSql, ToSic.Sxc.Dnn", DynamicOut = false, NameIds = new string[]{"ToSic.SexyContent.DataSources.DnnSqlDataSource, ToSic.SexyContent", "ToSic.SexyContent.Environment.Dnn7.DataSources.DnnSqlDataSource, ToSic.SexyContent"}, HelpLink = "https://github.com/2sic/2sxc/wiki/DotNet-DataSource-DnnSqlDataSource", ConfigurationType = "|Config ToSic.SexyContent.DataSources.DnnSqlDataSource")]
    public class DnnSql : Sql, IDataSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheInfo, ICacheKey, ICacheExpiring, ITimestamped, ICanPurgeListCache, IHasLog, IDataTarget, IAppIdentitySync, IDataSourceLinkable

    Implements

    IDataSource
    IAppIdentity
    IZoneIdentity
    IAppIdentityLight
    ICacheKey
    ICacheExpiring
    ITimestamped
    IHasLog
    IDataSourceLinkable
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX