zoukankan      html  css  js  c++  java
  • 简单配置gentle

    1.安装gentle 1.2.9 版
    2.加入专案的引用中
    Gentle.Common.dll
    Gentle.Framework.dll
    Gentle.Provider.SqlServer
     
    3.将文件gentle.config放到专案根目录下
    4.修改DefaultProvider及Providers为所用的数据 库

    eg:
    <DefaultProvider name="SQLServer" connectionString="Data Source=192.168.0.111;Initial Catalog=dbtest;Persist Security Info=True;User ID=sa;Password=sa" providerName="System.Data.SqlClient" />  
    <Provider     name="SQLServer"  assembly="Gentle.Provider.SQLServer" />

    5.可在页面中用gentle对象了
    eg:
    string strsql = "declare @DownAge int ";
            strsql 
    = strsql + "declare @UpperAge int ";
            strsql 
    = strsql + "select @DownAge=(select SysValue from dbo.m_stest where SysName='DownAge') ";
            strsql 
    = strsql + "select @UpperAge=(select SysValue from dbo.m_stest where SysName='UpperAge') ";
            strsql 
    = strsql + "select top 100 ";
            strsql 
    = strsql + "case when DATEADD(yy,-@DownAge,getdate())>=Birthday and DATEADD(yy,@UpperAge,Birthday)>getdate() ";
            strsql 
    = strsql + "then '是' else '否' end ";
            strsql 
    = strsql + "From m_test";
        SqlResult sr 
    = Broker.Execute(strsql);
        
    this.label1.Text = sr.GetString(00).ToString();
  • 相关阅读:
    代码规范总结
    git记住提交密码的技巧
    php foreach遍历
    flight学习笔记
    the resource is not on the build path of a php project
    Google安装postman插件
    PHP开发框架CodeIgniter
    eclipse中php项目开发的环境配置说明
    MyBatis入门篇
    mybatis学习(十二)——mybatis逆向工程
  • 原文地址:https://www.cnblogs.com/freeliver54/p/635069.html
Copyright © 2011-2022 走看看