日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
iBATIS.NET執(zhí)行存儲(chǔ)過(guò)程實(shí)例詳解

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

首先我們看看XML的配置,映射XML文件書(shū)寫(xiě)如下

 
 
 
  1. ﹤?xml version="1.0" encoding="utf-8" ?﹥  
  2.  
  3. ﹤sqlMap namespace="Member" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SqlMap.xsd"﹥  
  4.     ﹤resultMaps﹥  
  5.         ﹤resultMap id="SelectResult" class="PlatAdmin.Model.Member"﹥  
  6.             ﹤result property="Id" column="id" /﹥  
  7.             ﹤result property="Identityno" column="identityno" /﹥  
  8.             ﹤result property="Telephone" column="telephone" /﹥  
  9.             ﹤result property="Email" column="email" /﹥  
  10.             ﹤result property="Linktel" column="linktel" /﹥  
  11.             ﹤result property="Address" column="address" /﹥  
  12.             ﹤result property="Content" column="content" /﹥  
  13.             ﹤result property="Username" column="username" /﹥  
  14.             ﹤result property="Password" column="password" /﹥  
  15.             ﹤result property="Truename" column="truename" /﹥  
  16.             ﹤result property="Enable" column="enable" /﹥  
  17.             ﹤result property="Regdate" column="regdate" /﹥  
  18.         ﹤/resultMap﹥  
  19.     ﹤/resultMaps﹥  
  20.           
  21.     ﹤parameterMaps﹥  
  22.         ﹤parameterMap id="swapParas" class="PlatAdmin.Model.Member"﹥  
  23.             ﹤parameter property="querystr" column="" /﹥  
  24.             ﹤parameter property="keyfield" column="" /﹥  
  25.             ﹤parameter property="pagesize" column="" /﹥  
  26.             ﹤parameter property="pagenumber" column="" /﹥  
  27.         ﹤/parameterMap﹥  
  28.     ﹤/parameterMaps﹥  
  29.       
  30.     ﹤statements﹥  
  31.         ﹤procedure id="GetMemberList" parameterMap="swapParas" resultMap="SelectResult"﹥  
  32.             usp_GetRecordset  
  33.         ﹤/procedure﹥  
  34.  
  35.           
  36.     ﹤/statements﹥  
  37. ﹤/sqlMap﹥ 

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

 
 
 
  1. public IList GetMemberList(string querystr,int pageNo)  
  2.         {  
  3.             Hashtable ht = new Hashtable();  
  4.             ht.Add("querystr",querystr);  
  5.             ht.Add("keyfield","id");  
  6.             ht.Add("pagesize",2);  
  7.             ht.Add("pagenumber",pageNo);  
  8.  
  9.             SqlMapper sqlMap = IBatisNet.DataMapper.Mapper.Instance();  
  10.  
  11.             try 
  12.             {  
  13.                 return sqlMap.QueryForList("GetMemberList",ht);  
  14.             }  
  15.             catch(Exception e)  
  16.             {  
  17.                 throw new IBatisNetException(e.Message,e);  
  18.             }  
  19.         } 

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

【編輯推薦】

  1. iBATIS教程之like語(yǔ)句的寫(xiě)法淺析
  2. iBATIS.NET多數(shù)據(jù)庫(kù)支持淺析
  3. iBATIS教程之如何獲得output參數(shù)值
  4. iBATIS.NET處理多參數(shù)的SQL語(yǔ)句的配置
  5. iBATIS.NET與VS 2005進(jìn)行單元測(cè)試淺析

分享名稱:iBATIS.NET執(zhí)行存儲(chǔ)過(guò)程實(shí)例詳解
網(wǎng)頁(yè)網(wǎng)址:http://www.5511xx.com/article/djposdh.html