SearchBySql
Java:
public List<Accountingdisclosure> searchAccountingdisclosuresBySql(String sqlStr)throws Exception {
DBOperator dbo = getDBOperator();
try {
AccountingdisclosureTableAdapter adapter = new AccountingdisclosureTableAdapter(dbo);
return adapter.select(sqlStr);
} catch (Exception e) {
dbo.rollback();
throw e;
} finally {
dbo.close();
}
} Sql="(createddate>='2013-02-18 00:00:00' and createddate<='2013-02-18 23:59:59')";
.NET:
private void LoadAccountingDisclosureData()
{
AccountingCollection.Clear();
string starttime = DateTime.Now.Date.ToString("yyyy-MM-dd") + " 00:00:00";
string endtime = DateTime.Now.Date.ToString("yyyy-MM-dd") + " 23:59:59";
string sql = "(createddate>='" + starttime + "' and createddate<='" + endtime+"')";
//Sql="(createddate>='2013-02-18 00:00:00' and createddate<='2013-02-18 23:59:59')"; List<Accountingdisclosure> accountings = accountingAction.SearchAccountingdisclosuresBySql(sql); if (accountings != null && accountings.Count>)
{
IOrderedEnumerable<Accountingdisclosure> orders = accountings.OrderByDescending(a => a.Createddate);
foreach (Accountingdisclosure accounting in orders)
{
AccountingCollection.Add(accounting);
}
} }
SearchBySql的更多相关文章
随机推荐
- UVA 11732 - strcmp() Anyone?(Trie)
UVA 11732 - strcmp() Anyone? 题目链接 题意:给定一些字符串,要求两两比較,须要比較的总次数(注意.假设一个字符同样.实际上要还要和'\0'比一次,相当比2次) 思路:建T ...
- SWD and JTAG selection mechanism
SWD and JTAG selection mechanism SWJ-DP enables either an SWD or JTAG protocol to be used on the deb ...
- CRC 概述
Acquired from: ftp.adelaide.edu.au:/pub/rocksoft/crc_v3.txt or ftp://ftp.rocksoft.com/papers/crc_v3. ...
- CAS与LDAP集成
参考文献: CAS集成ldap:https://wiki.jasig.org/display/CASUM/LDAP CAS集成restful api:https://wiki.jasig.org/di ...
- 学一点 MYSQL 双机异地热备份—-MYSQL主从,主主备份原理及实践
简单介绍mysql双机,多机异地热备简单原理实战. 双机热备的概念简单说一下,就是要保持两个数据库的状态自动同步.对任何一个数据库的操作都自动应用到另外一个数据库,始终保持两个数据库数据一致. 这样做 ...
- MyEclipse 2014 for Mac 在Yosemite怎樣安裝
相信大家都在安裝MyEclipse 2014 for Mac時候會遇到提示虚拟内存为0,,无法安装...小弟找了解決方法...1. 先下載軟件及破解檔案. http://pan.baidu.com ...
- 清除数据库表、外键、存储过程SQL
1.删除所有外键 ) begin exec(@c1) fetchnextfrom c1 into@c1 endclose c1deallocate c1 2. ...
- 如何修改Oracle Enterprise Linux时区?
修改/etc/sysconfig/clock [root@psdyy-2 ~]# cat /etc/sysconfig/clock ZONE="Asia/Shanghai" UTC ...
- JavaScript 检查IP
//---------------------------------------------------------- // 功能:检查IP // 参数: // strpart ip地址 // 返回 ...
- 女子监狱第一季/全集Orange Is the New Black迅雷下载
本季第一季 Orange Is the New Black 1 (2013) 看点:该剧描述主人公Piper Chapman(Taylor Schilling)在大学里结识了毒贩Alex(Laura ...