Uploaded image for project: 'iBatis for .NET'
  1. iBatis for .NET
  2. IBATISNET-272

Add QueryForDataTable method on DataMapper API

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • DataMapper 3.0
    • DataMapper 3.0
    • DataMapper
    • None

    Description

      /// <summary>
      /// Executes a SQL SELECT statement that returns data
      /// to populate a DataTable.
      /// If a resultMap is specified, the column name will be the result property name.
      /// </summary>
      /// <param name="statementId">The statement id.</param>
      /// <param name="parameterObject">The parameter object.</param>
      /// <returns>A DataTable</returns>
      public DataTable QueryForDataTable(string statementId, object parameterObject)

      Specify "dataTable" or "data" as type alias (buil-in ibatis)

      <resultMap id="Account-result-DataTable" class="dataTable">
      <result property="Id" column="Account_ID"/>
      <result property="FirstName" column="Account_FirstName"/>
      </resultMap>

      <select id="SimpleAccountDataTableViaResultMap" parameterClass="int" resultMap="Account-result-DataTable">
      select *
      from Accounts
      </select>

      <select id="SimpleAccountDataTable" parameterClass="int" resultClass="data">
      select *
      from Accounts
      </select>

      Attachments

        Activity

          People

            gilles Gilles Bayon
            gilles Gilles Bayon
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: