惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
The GitHub Blog
The GitHub Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Announcements
Recent Announcements
量子位
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
T
Tailwind CSS Blog
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
G
Google Developers Blog
M
MIT News - Artificial intelligence

博客园 - 寂寞沙洲

工作室案例在线展示 流风ASP.NET框架商业版-工作流1.0简介 流风ASP.NET框架企业版试用地址公布 三分钟完成新建模块-ASP.NET通用框架教程 流风ASP.NET 通用管理框架正式版源码+专用代码生成器 ASP.NET通用管理系统代码生成器使用视频 ASP.NET通用系统框架+专用代码生成器 有趣的新年祝福小程序 实战CRM系统项目:4.基础配置-区域管理 实战CRM系统项目:3.系统架构设计 实战CRM系统项目:2.概要设计,数据库设计 实战CRM系统项目:1.需求分析 流星ASP.NET权限基础管理系统源码发布 ASP.NET基础权限系统 项目实战之CRM系统(一)前言 NickLee.FortuneBase数据库sql server修正版 NickLee.FortuneBase数据库sql server版工具篇 NickLee.FortuneBase数据库sql server版新增页面视频演示 NickLee.FortuneBase数据库sql server版新增页面详细说明
IBatisNet系列-执行存储过程 - 寂寞沙洲 - 博客园
寂寞沙洲 · 2008-03-28 · via 博客园 - 寂寞沙洲

映射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" /> 字串1
            <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>
 程序代码如下:


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(); 字串2

            try
            {
                return sqlMap.QueryForList("GetMemberList",ht);
            }
            catch(Exception e)
            {
                throw new IBatisNetException(e.Message,e);
            }
        }