溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

iBATIS.NET執(zhí)行存儲(chǔ)的過程分析

發(fā)布時(shí)間:2021-10-28 10:27:50 來源:億速云 閱讀:112 作者:柒染 欄目:編程語言

iBATIS.NET執(zhí)行存儲(chǔ)的過程分析,針對(duì)這個(gè)問題,這篇文章詳細(xì)介紹了相對(duì)應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問題的小伙伴找到更簡單易行的方法。

iBATIS.NET執(zhí)行存儲(chǔ)過程是怎么進(jìn)行的呢?那么我們就開始我們的講解:

首先我們看看XML的配置,映射XML文件書寫如下

﹤?xml version="1.0" encoding="utf-8" ?﹥   ﹤sqlMap namespace="Member" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SqlMap.xsd"﹥      ﹤resultMaps﹥          ﹤resultMap id="SelectResult" class="PlatAdmin.Model.Member"﹥              ﹤result property="Id" column="id" /﹥              ﹤result property="Identityno" column="identityno" /﹥              ﹤result property="Telephone" column="telephone" /﹥              ﹤result property="Email" column="email" /﹥              ﹤result property="Linktel" column="linktel" /﹥              ﹤result property="Address" column="address" /﹥              ﹤result property="Content" column="content" /﹥              ﹤result property="Username" column="username" /﹥              ﹤result property="Password" column="password" /﹥              ﹤result property="Truename" column="truename" /﹥              ﹤result property="Enable" column="enable" /﹥              ﹤result property="Regdate" column="regdate" /﹥          ﹤/resultMap﹥      ﹤/resultMaps﹥                ﹤parameterMaps﹥          ﹤parameterMap id="swapParas" class="PlatAdmin.Model.Member"﹥              ﹤parameter property="querystr" column="" /﹥              ﹤parameter property="keyfield" column="" /﹥              ﹤parameter property="pagesize" column="" /﹥              ﹤parameter property="pagenumber" column="" /﹥          ﹤/parameterMap﹥      ﹤/parameterMaps﹥            ﹤statements﹥          ﹤procedure id="GetMemberList" parameterMap="swapParas" resultMap="SelectResult"﹥              usp_GetRecordset          ﹤/procedure﹥                 ﹤/statements﹥  ﹤/sqlMap﹥

iBATIS.NET執(zhí)行存儲(chǔ)過程實(shí)例程序代碼如下:

public IList GetMemberList(string querystr,int pageNo)          {              Hashtable ht = new Hashtable();              ht.Add("querystr",querystr);              ht.Add("keyfield","id");              ht.Add("pagesize",2);              ht.Add("pagenumber",pageNo);               SqlMapper sqlMap = IBatisNet.DataMapper.Mapper.Instance();               try             {                  return sqlMap.QueryForList("GetMemberList",ht);              }              catch(Exception e)              {                  throw new IBatisNetException(e.Message,e);              }          }

iBATIS.NET執(zhí)行存儲(chǔ)過程實(shí)例的情況就介紹到這里,希望對(duì)你有所幫助。

關(guān)于iBATIS.NET執(zhí)行存儲(chǔ)的過程分析問題的解答就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注億速云行業(yè)資訊頻道了解更多相關(guān)知識(shí)。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI