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的更多相关文章
随机推荐
- NXP ARM Vector Table CheckSum
Signature Creator for NXP Cortex-M Devices Algorithm for creating the checksum The reserved Cortex-M ...
- How to convert a byte to its binary string representation
How to convert a byte to its binary string representation For example, the bits in a byte B are 1000 ...
- bitnami下webmin安装
下载 我在官方网站下载最新的安装包(webmin_1.670_all.deb):http://sourceforge.net/projects/webadmin/files/webmin 安装 单独 ...
- [置顶] Android系统移植与调试之------->build.prop文件详细赏析
小知识:什么是build.prop? /system/build.prop 是一个属性文件,在Android系统中.prop文件很重要,记录了系统的设置和改变,类似於/etc中的文件.这个文件是如 ...
- Java进程线程理解
一个进程包括由操作系统分配的内存空间,包含一个或多个线程.一个线程不能独立的存在,它必须是进程的一部分.一个进程一直运行,直到所有的非守护线程都结束运行后才能结束. 多线程能满足程序员编写高效率的程序 ...
- Spring Boot 2中对于CORS跨域访问的快速支持
原文:https://www.jianshu.com/p/840b4f83c3b5 目前的程序开发,大部分都采用前后台分离.这样一来,就都会碰到跨域资源共享CORS的问题.Spring Boot 2 ...
- netty 自定义通讯协议
Netty中,通讯的双方建立连接后,会把数据按照ByteBuf的方式进行传输,例如http协议中,就是通过HttpRequestDecoder对ByteBuf数据流进行处理,转换成http的对象.基于 ...
- python测试开发django-28.发送邮件send_mail
前言 django发邮件的功能很简单,只需简单的配置即可,发邮件的代码里面已经封装好了,调用send_mail()函数就可以了 实现多个邮件发送可以用send_mass_mail()函数 send_m ...
- Fix "Drives are running out of free space" Error in SharePoint Health Analyzer
前言 最近帮助用户做健康检查,用户发现事件查看器(EventView)里面有很多错误,有一个就是"Drives are running out of free space",而且每 ...
- tsung执行时报Can't locate Template.pm的解决
[root@openfire-x86v-app01 20141118-0931]# tsung_stats creating subdirectory data creating subdirecto ...