• Articles
  • Api Documentation

    Show / Hide Table of Contents
    • DataBaseAccess
      • DataBaseAccess
        • DataAccessService
        • IDataAccessService
        • QueryResult
      • DataBaseAccess.Extensions
        • DataReaderExtension
    • EmailLib
      • EmailLib
        • EmailService
        • SmtpServerConfig
    • WebApplication
      • WebApplication
        • _Default
        • About
        • Account
        • Account.ActiveNav
        • AppConfig
        • AppConfig.Json
        • AppConfig.SmtpServer
        • AppConfig.WebSite
        • AppConfig.Xml
        • BundleConfig
        • CambiarPassword
        • Confirmar
        • Contact
        • EmailSent
        • Global
        • Inicio
        • RedirectPage
        • Registro
        • RouteConfig
        • ScriptResource
        • Site_Mobile
        • SiteMaster
        • ViewSwitcher
        • WebAlertNotification
      • WebApplication.ComprobarMatriculaService
        • comprobarCompletedEventArgs
        • comprobarCompletedEventHandler
        • Matriculas
      • WebApplication.CustomControls
        • ConnectedUsers
        • WebNotification
      • WebApplication.Framework
        • AlertLevel
        • AppSecurity
        • ConnectedUsersTrack
        • NotificationData
        • ParametizedUrl
        • Query
        • Query.GenericTasks
        • UserRole
        • UserType
      • WebApplication.Framework.Extensions
        • AttributeCollectionExtension
        • DictionaryExtension
      • WebApplication.TimeMeanWebService
        • GetAllSubjectsMeansCompletedEventArgs
        • GetAllSubjectsMeansCompletedEventHandler
        • GetSubjectMeansCompletedEventArgs
        • GetSubjectMeansCompletedEventHandler
        • SubjectsMeansService
      • WebApplication.UserPages
        • Coordinador
        • ExportarTareas
        • ImportarTareasDataSet
        • ImportarTareasXmlDocument
        • InsertarTarea
        • InstanciarTarea
        • Student
        • StudentHome
        • StudentMenu
        • TareasAlumno
        • TareasProfesor
        • Teacher
        • TeacherHome
        • TeacherMenu
      • WebApplication.Utils
        • JsonFile
        • UrlUtils

    Interface IDataAccessService

    Namespace: DataBaseAccess
    Assembly: DataBaseAccess.dll
    Syntax
    public interface IDataAccessService

    Properties

    | Improve this Doc View Source

    ConnectionString

    Property containing the connection string to the database.

    Declaration
    string ConnectionString { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    CreateQueryDataTable(String, Dictionary<String, Object>, CommandType)

    Creates and returns a System.Data.DataTable with the sql query string passed as parameter.

    Declaration
    DataTable CreateQueryDataTable(string query, Dictionary<string, object> parameters = null, CommandType commandType = CommandType.Text)
    Parameters
    Type Name Description
    System.String query

    The sql query to execute

    System.Collections.Generic.Dictionary<System.String, System.Object> parameters

    The query aditional parameters

    System.Data.CommandType commandType

    Indicates how the query string will be interpreted. The default is System.Data.CommandType.Text

    Returns
    Type Description
    System.Data.DataTable

    The created System.Data.DataTable

    | Improve this Doc View Source

    NonQuery(String, Dictionary<String, Object>, CommandType)

    Executes the passed sql query in the database and returns the number of rows affected. For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command. When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of rows affected by the trigger or triggers. For all other types of statements and rollbacks the return value is -1.

    Declaration
    int NonQuery(string query, Dictionary<string, object> parameters = null, CommandType commandType = CommandType.Text)
    Parameters
    Type Name Description
    System.String query

    The sql query to execute

    System.Collections.Generic.Dictionary<System.String, System.Object> parameters

    The query aditional parameters

    System.Data.CommandType commandType

    Indicates how the query string will be interpreted. The default is System.Data.CommandType.Text

    Returns
    Type Description
    System.Int32

    The number of rows affected

    | Improve this Doc View Source

    Query(String, Dictionary<String, Object>, CommandType)

    Executes the passed sql query in the database and returns a System.Collections.Generic.List<T> of elements of type System.Collections.Generic.Dictionary<TKey, TValue>. Each element in the list represents a row and each dictionary element represents a column. The column value can be accesed by its same.

    Declaration
    QueryResult Query(string query, Dictionary<string, object> parameters = null, CommandType commandType = CommandType.Text)
    Parameters
    Type Name Description
    System.String query

    The sql query to execute

    System.Collections.Generic.Dictionary<System.String, System.Object> parameters

    The query aditional parameters

    System.Data.CommandType commandType

    Indicates how the query string will be interpreted. The default is System.Data.CommandType.Text

    Returns
    Type Description
    QueryResult

    A collection of rows returned by the query

    | Improve this Doc View Source

    Scalar<T>(String, Dictionary<String, Object>, CommandType)

    Retrieve a single value from a database. It returns the first column of the first row in the result set returned by the query, the additional columns or rows are ignored.

    Declaration
    T Scalar<T>(string query, Dictionary<string, object> parameters = null, CommandType commandType = CommandType.Text)
    Parameters
    Type Name Description
    System.String query

    The sql query to execute

    System.Collections.Generic.Dictionary<System.String, System.Object> parameters

    The query aditional parameters

    System.Data.CommandType commandType

    Indicates how the query string will be interpreted. The default is System.Data.CommandType.Text

    Returns
    Type Description
    T

    The first column of the first row in the result set, or a null reference if the result set is empty.

    Type Parameters
    Name Description
    T

    The expected scalar query type

    • Improve this Doc
    • View Source
    Back to top Copyright © 2019 Ferran Tudela