SubSonic.SqlQuery的日期範圍是/還是日期範圍?如果不是的話,那麼獲得一個範圍的最好方法是什麼?SubSonic SubSonic.SqlQuery&日期
0
A
回答
3
嘗試這樣:
SqlQuery query = new SqlQuery().From("Table")
.WhereExpression("Column")
.IsBetweenAnd("1/1/2008", "12/31/2008");
DataSet dataSet = query.ExecuteDataSet(); // Or whatever output you need
2
另一種方式亞音速查詢。
TableCollection data = new TableCollection();
Query q = Table.CreateQuery()
.BETWEEN_AND("Column", "1/1/2008", "12/31/2008");
data.LoadAndCloseReader(q.ExecuteReader());
// loop through collection
0
聯合羅斯文答案:
SqlQuery query = new SqlQuery().From("Orders")
.WhereExpression("OrderDate")
.IsBetweenAnd("1996-07-02", "1996-07-08");
DataSet dataSet = query.ExecuteDataSet(); // Or whatever output you need
#region PresentResultsReplaceResponseWriteWithConsole.WriteLineForConsoleApp
DataTable dt = dataSet.Tables[0];
Response.Write("<table>");
foreach (DataRow dr in dt.Rows)
{
Response.Write("<tr>");
for (int i = 0; i < dt.Columns.Count; i++)
{
Response.Write("<td>");
Response.Write(dr[i].ToString() + " ");
Response.Write("<td>");
} //eof for
Response.Write("</br>");
Response.Write("</tr>");
}
Response.Write("<table>");
#endregion PresentResultsReplaceResponseWriteWithConsole.WriteLineForConsoleApp
相關問題
- 1. Subsonic 3.0 ActiveRecord日期
- 2. SubSonic.SqlQuery ExecuteTypedList <T>只返回新的對象
- 3. Inner Subsonic與subsonic
- 4. 從MySQL使用SubSonic 3填充沒有日期時間值Linq
- 5. Subsonic Aggregation Constraint(「Having」)
- 6. SubSonic.SqlQuery在使用Where時錯誤地生成()
- 7. Subsonic ActiveRecord
- 8. SubSonic CreatedBy
- 9. SubSonic - 劃分web.config
- 10. Oracle,Subsonic 3和TableSpaceName
- 11. SubSonic SQL CE錯誤
- 12. 對SubSonic的貢獻
- 13. .netTiers vs SubSonic
- 14. SubSonic OpenExpression/CloseExpression
- 15. SubSonic 2.2預測
- 16. subsonic 2.1 gac?
- 17. subsonic 3.0.0.3 activeRecord
- 18. SubSonic 3.0.0.2/3 | SimpleRepository
- 19. Subsonic和DB4O
- 20. Subsonic和CSLA.NET
- 21. Subsonic多對多
- 22. SubSonic Collection Top 1
- 23. SubSonic ORM with backbone.js
- 24. 重建subsonic 2.2
- 25. SubSonic RESTHandler問題
- 26. SubSonic與Castle ActiveRecord
- 27. Subsonic MySQL版本
- 28. Subsonic 3 LeftOuterJoin
- 29. subsonic和sp_help_job
- 30. subsonic 3 oracle
這是另一個片斷..這結束了我的解決方案.. 。而(Order.OrderDateColumn).IsBetweenAnd(lastRunDate,System.DateTime.Now ); – madcolor 2008-10-03 14:47:07