1.安装gentle 1.2.9 版
2.加入专案的引用中
3.将文件gentle.config放到专案根目录下
4.修改DefaultProvider及Providers为所用的数据 库
eg:
5.可在页面中用gentle对象了
eg:
2.加入专案的引用中
Gentle.Common.dll
Gentle.Framework.dll
Gentle.Provider.SqlServer
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 " />
< 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( 0 , 0 ).ToString();
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( 0 , 0 ).ToString();