Chủ Nhật, 13 tháng 11, 2011

Sử dụng SUM trong Nhibernate Criteria API

Một ví dụ đơn giản để SUM cước cuộc gọi trong 1 khoảng thời gian.

  1. Object obj = callManManager.CreateCriteria()
  2. .Add(Expression.Ge("CallDate", sDate))
  3. .Add(Expression.Le("CallDate", sDate1))
  4. .SetProjection(Projections.Sum("Vnd"))
  5. .UniqueResult();
  6. if (obj != null)
  7. {
  8. double tongtieng = (double) obj;
  9. txtTongTien.Text = tongtieng.ToString("");
  10. }
dFrom và dEnd là 2 thời điểm, Cost là tiền cước ta muốn SUM.

Thứ Tư, 9 tháng 11, 2011

SQL 2008 – Change "Edit Top 200 Rows"

go to

Tools

Options

SQL Server Object Explorer, Expand this tree

Choose ‘Commands’

And there you go change it to your desired amount, 0 = everything!