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);
}
} }