iBATIS.NET执行存储的过程分析

发布时间:2021-10-28 10:27:50 作者:柒染
来源:亿速云 阅读:115

iBATIS.NET执行存储的过程分析,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。

iBATIS.NET执行存储过程是怎么进行的呢?那么我们就开始我们的讲解:

首先我们看看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执行存储过程实例程序代码如下:

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执行存储过程实例的情况就介绍到这里,希望对你有所帮助。

关于iBATIS.NET执行存储的过程分析问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注亿速云行业资讯频道了解更多相关知识。

推荐阅读:
  1. 怎么执行MySQL的存储过程
  2. MySQL的查询过程分析

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

ibatis.net

上一篇:怎样轻松配置iBatis.net

下一篇:Mysql数据分组排名实现的示例分析

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》